The PuTTY download

The official address

Common Usage of PuTTY

Click Session on the left and enter Host Name and Port; Enter Saved Sessions as the Save name and click Save.

  1. You can enter the Host Name in the FORMAT of user@ip or the IP address directly
  2. The default Port number is 22. If the SSH Port number is changed, you need to change it
  3. Saved Sessions can save the configuration and download it so that you can click Load to read it the next time you connect

If the server does not support user name and password login, you may need to configure a private key file for authentication. Choose Connection > SSH > Auth and select a private key file, such as PPK file. After selecting, remember to Save.

The PuTTY tunnel

Local

This port is used to map services on the server to a port on the local host. Accessing the port on the local host actually accesses services on the server.

For example, to establish A tunnel through SSH on machine A and access MySQL on machine B, you need to enter the local Port in Source Port, and enter the MySQL machine < LAN IP: Port number > in Destination.

  1. Source port is a local port
  2. Destination is the Destination IP address and Port, that is, the LAN address and Port of the machine to be accessed

You can run mysql -u root -p -h 127.0.0.1 -p 13306 to access mysql.

Remote

In contrast with Local, you can map a Local port to a port on the server and access the port on the server to access Local services.

For example, to establish A tunnel through SSH of machine A and access the local MySQL, enter the mapped Port of machine A (for example, 3308) in Source Port, and enter the local < LAN IP: Port number > in Destination.

After the configuration is complete, click Open. The server can use mysql -u root -p -h 127.0.0.1 -p 3308 to access the local mysql