https://www.techtarget.com/searchsecurity/tutorial/How-to-use-PuTTY-for-SSH-key-based-authentication
Running multiple OSes is a common reality in today's business environments. Take workstations and servers, for example. A Windows workstation might need to connect to Linux servers, IoT systems and network devices. The challenge faced, however, is connecting these environments securely and keeping data protected.
PuTTY is one tool that can help with this.
SSH is a networking protocol that enables secure access to a computer or device over an unsecure network. Many Linux servers and network devices accept inbound SSH connections for remote configuration. Sysadmins use SSH to connect to remote devices and do the following:
PuTTY is an open source GUI implementation of the Secure Shell protocol that has long been used to run secure SSH tunnels to and from Windows computers. Initially released in 1999, PuTTY grew in popularity because Windows did not include the OpenSSH command line client and server until Windows 10 and later.
PuTTY remains a viable alternative to OpenSSH today because its GUI might be easier for admins to customize. Managing multiple SSH profiles is also simpler in PuTTY, as are other customizations, such as selecting encryption keys.
PuTTY can be downloaded here. Follow these steps to install it:
Once complete, you can view the README file for basic guidance or exit. PuTTY is ready for use.
Assume the targeted Linux system is configured for inbound SSH connections with no special settings. For example, root is allowed over SSH, the firewall permits TCP port 22, default password-based authentication is set, etc.
Launch PuTTY on a Windows workstation and type the destination IP address in the HOST Name (or IP address) box. Ensure SSH is selected from the Connection type radio options. Click Open.
The remote Linux system will prompt you for the name and password of a local user account. A new window will open and display your SSH session.
The first time you establish a connection, you will receive a PuTTY Security Alert informing you the remote server's host key is not cached. It's verifying the destination server is the device you believe it is. Click Accept if you're confident of the identity of the remote system.
Saving connection specifications lets you quickly connect to frequently accessed remote servers. Type the remote system's hostname or IP address, select the Saved Sessions box, and enter a name for the connection. You can use whatever descriptive name you want. Select Save, and the session name appears in the box. This can be done for multiple destinations. Select one and click Open to connect to it.
If you connect to many servers via PuTTY and must manage their keys, consider using Pageant, PuTTY's authentication agent application.
Key-based authentication is strongly recommended. It's a common requirement on Linux certification exams, a standard step in enterprise Linux configurations, and an industry best practice. Key-based authentication also makes automated tasks via scripting and Ansible easier.
Follow these three steps to configure key-based authentication in PuTTY:
PuTTY includes an application called PuTTYgen to create key pairs. Do the following on the Windows SSH client that will connect to the remote Linux SSH server:
On the Linux server, accessed from the local Windows client, do the following:
Use the main PuTTY application to configure the PuTTY client to use key-based authentication.
You are now ready to test the connection. Expect the connection to be established without a password challenge.
You've successfully configured PuTTY to use key-based authentication.
Note that the private key can be protected with a passphrase, which will need to be entered each time the connection is made.
Other key authentication settings for SSH and PuTTY include the following:
Damon Garn owns Cogspinner Coaction and provides freelance IT writing and editing services. He has written multiple CompTIA study guides, including the Linux+, Cloud Essentials+ and Server+ guides, and contributes extensively to TechTarget Editorial and CompTIA Blogs.
25 Jul 2024