How to Use PuTTY to Connect to Linux from Windows

Setting up a remote Linux server? Or maybe you have a Linux work media center, PC, or a secondary PC in another area. And whatever the case is, you will need to remote connect to a computer through a Windows PC or laptop. A great way to get remote access to a Linux device is via PuTTY or SSH (Secure Shell) is a secure way to access Linux through Windows or other devices. 

PuTTY is a telnet client and an SSH or Secure Shell. Simon Tatham originally developed PuTTY for the Windows platform. The open software is available with source code. PuTTY is supported and developed by a group of volunteers. PuTTY allows you to connect securely to remote servers from your Windows PC. Follow these simple steps to connect to a remote Linux server. 

Installing

If you have not installed PuTTY yet, click the Download PuTTY page. Download the Windows Installer from the “Package Files” part seen on the page. If you are unsure of which installer to choose, most likely download the 64-bit MSI Windows Installer.

Run the installer and follow the steps given. After installation is complete, launch the PuTTY application to begin the configuration.

Configuration

When launching PuTTY, the configuration’s main session screen will pop up. A various number of options are available, but you will only need to adjust a few of them.

  • Begin by typing the Host Name or IP address of the server you want to connect your server to. You can specifically put the user you wish to connect to the server by adding it before the hostname of the server, then put an “@” for the text to resemble an email address. 
  • The Port is set at 22 by default because on most servers, 22 is the standard port for SSH. Then, adjust the numbers accordingly. Servers often use custom SSH ports to help avoid automated hacking tools. The ports are the following: 
  • Shared or reseller server: 1291
  • Legacy VPS (Xen/OpenVZ/KVM): 1891
  • Dedicated servers: 1157
  • Ensure that the Connection Type is adjusted to SSH
  • If you are not making use of a private key to connect to the server and you do not want to save your configuration for future use, click “Open” to initiate an immediate SSH connection to your server to authenticate through your account password. 
  • PuTTY displays a “Security Alert” if it is your first time connecting to your server. The “Security Alert” lets you know that PuTTY does not have a key in the registry for this particular server. It is a standard protocol for your first connection. 
  • Click “Yes” if everything is OK. PuTTY will remember the server and will not warn you about connecting in the future unless the server seems different for another reason, in which case you will see a warning. 
  • Click “No” if you are uncertain if this is OK, but you still want to connect. PuTTY will try to connect but will alert you the next time you want to connect.
  • Click “Cancel” if you think this server is compromised. PuTTY will terminate the connection. 
  • A window will open so you can enter your password. The new window will open if the connection was a success.
  • If you typed everything correctly, you will connect to a shell on your server. 

Authentication of SSH Key

You can configure PuTTY to use SSH keys. SSH keys are more secure and often more convenient when authenticating. 

  • On the main configuration screen’s sidebar, click the small + located near the SSH to show more options for SSH configuration. Then click the Auth option so you can view the options for authentication. 
  • Click on Browse at the bottom right side of the screen under “Private key for authentication.” 
  • Choose the saved .ppk SSH key file from your computer.
  • Click the “Open” button and follow the fifth step from the configuration portion mentioned above to connect as soon as possible, or not. 

Saving PuTTY Configuration

You can save your configuration that connects to a server for quicker access, and you do not have to type all the information every time as a “Session.” 

  • Congratulations, you are finally ready to connect after filling out all the required fields. Ensure that your screen is the main session configuration as mentioned before. Your server hostname and port number should be visible.
  • Type a name for the SSH session configuration you saved under the text box, “Saved Sessions,” and click “Save.” Your newly created session will appear in the list under the text box below “Default Settings.”

There are also different methods to remote connect to a computer like using Virtual Network Connection (VNC) or Remote Desktop Protocol (RDP). Using PuTTY is beneficial because it helps you make changes to Linux easily. Using SSH is also great for servers without a desktop environment.