Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

Configure “No Password SSH Keys Authentication” with PuTTY on Linux Servers - DesignLinux

Nov 09 2021
designlinux 0 Comments

SSH (Secure SHELL) is one of the most used network protocols to connect and login to remote Linux servers, due to its increased security provided by its cryptographic secure channel established for data flow over insecure networks and its Public Key Authentication.

While using SSH passwords to log in to remote Linux servers can provide less secure system security because a password can be brute-force cracked.

SSH Public Key Authentication provides the best secure method to perform distance logins, because it’s almost impossible to decipher the key, and the private key guarantees that the sender it’s always who it claims to be.

[ You might also like: How to Secure and Harden OpenSSH Server ]

This article will show you how you can generate and use SSH Keys from Windows-based platforms using Putty client to automatically perform remote logins on Linux servers without the need to enter passwords.

Step 1: Install Putty and Generate SSH Key Pairs

1. The first step you need to take is to go to the official Putty download page, grab the last version of the Putty Windows Installer executable package and install it onto your Windows computer.

Download Putty
Download Putty

2. After you have finished installing Putty go to Windows Start, type putty string to search field, and open PuTTygen program which you will use to generate Keys pairs.

Start Puttygen in Windows
Start Puttygen in Windows

3. Once the program opened, it’s time to proceed with Keys generation. Select SSH-2 RSA Key with 2048 bits, hit the Generate button, and move the cursor randomly on the Putty Key Generator field window as presented in the screenshots below in order to produce SSH Keys.

Generate SSH Key in Putty
Generate SSH Key in Putty
Generating SSH Key in Putty
Generating SSH Key in Putty

4. After the Keys are generated, add a descriptive Key comment to help you easily identify your key and Save both keys (Public and Private Keys) to a secure location on your computer.

Pay extra attention to where you save the Private Key because if anyone steals this key it can perform logins to your server without the need to enter a password.

[ You might also like: Useful PuTTY Configuration Tips and Tricks ]

Also, to enforce Keys security you can choose a passphrase to protect your keys, but you might want to avoid passwords for automated processes because it will ask you to enter the password key every time you perform server login.

Add Key Comment
Add Key Comment
Save SSH Public Keys
Save SSH Public Keys
Save SSH Private Keys
Save SSH Private Keys
Location of SSH Keys
Location of SSH Keys

5. After you have saved both Keys, don’t close the Putty Key Generator window yet, select copy and save the text field of Public Key into a text file which will be later pasted into the OpenSSH authorized_keys file on the remote server.

Copy SSH Public Key
Copy SSH Public Key
Location of Authorized Keys
Location of Authorized Keys

Step 2: Copy SSH Key to Perform PasswordLess Login Using Putty

6. Now it’s time to copy the key to the destination remote server and perform automatic login connections. Login to server with your administrative user (root or an account with root powers) using Putty and create .ssh directory and authorized_keys file onto its home path by issuing the following commands.

# pwd   		## To see if you are in the correct $HOME location
# mkdir .ssh
# nano .ssh/authorized_keys

7. On the authorized_keys file opened for editing in Putty, paste the content from the Public Key that you copied earlier from Putty Key Generator, save and close the file, view the contents, protect the folder, and authorized_keys with 700 permissions, and exit from the server.

# cat .ssh/authorized_keys
# chmod -R 700 .ssh/
# exit
Copy SSH Public Key to Remote Linux
Copy SSH Public Key to Remote Linux

8. In order to automatically connect and login to your server you need to add the Private Key to the Putty client. Open Putty and add your server login user followed by your server IP Address or FQDN on Host Name field in the form of [email protected], enter your server SSH Port number if it was changed.

Then go to the left Category menu, select SSH –> Auth, hit the Browse button, search and add your Private Key.

Add SSH Private Key to Putty
Add SSH Private Key to Putty

9. After you added the Private Key, go back to the Session menu, enter a descriptive name to the Saved Session field, and hit the Save button to save your current Putty session.

Putty Linux Login
Putty Linux Login

10. That’s it! Now you can automatically securely connect to your remote SSH server with Putty client by hitting the Open button without the need to enter passwords.

Putty SSH Passwordless Login
Putty SSH Passwordless Login

[ You might also like: SSH Passwordless Login Using SSH Keygen ]

Related

Tags: putty

Cockpit – A Powerful Tool to Monitor and Administer Multiple Linux Servers via Browser

Prev Post

22 Useful Terminal Emulators for Linux

Next Post
Archives
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • July 2022
  • June 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
Categories
  • AlmaLinux
  • Android
  • Ansible
  • Apache
  • Arch Linux
  • AWS
  • Backups
  • Bash Shell
  • Bodhi Linux
  • CentOS
  • CentOS Stream
  • Chef
  • Cloud Software
  • CMS
  • Commandline Tools
  • Control Panels
  • CouchDB
  • Data Recovery Tools
  • Databases
  • Debian
  • Deepin Linux
  • Desktops
  • Development Tools
  • Docker
  • Download Managers
  • Drupal
  • Editors
  • Elementary OS
  • Encryption Tools
  • Fedora
  • Firewalls
  • FreeBSD
  • FTP
  • GIMP
  • Git
  • Hadoop
  • HAProxy
  • Java
  • Jenkins
  • Joomla
  • Kali Linux
  • KDE
  • Kubernetes
  • KVM
  • Laravel
  • Let's Encrypt
  • LFCA
  • Linux Certifications
  • Linux Commands
  • Linux Desktop
  • Linux Distros
  • Linux IDE
  • Linux Mint
  • Linux Talks
  • Lubuntu
  • LXC
  • Mail Server
  • Manjaro
  • MariaDB
  • MongoDB
  • Monitoring Tools
  • MySQL
  • Network
  • Networking Commands
  • NFS
  • Nginx
  • Nodejs
  • NTP
  • Open Source
  • OpenSUSE
  • Oracle Linux
  • Package Managers
  • Pentoo
  • PHP
  • Podman
  • Postfix Mail Server
  • PostgreSQL
  • Python
  • Questions
  • RedHat
  • Redis Server
  • Rocky Linux
  • Security
  • Shell Scripting
  • SQLite
  • SSH
  • Storage
  • Suse
  • Terminals
  • Text Editors
  • Top Tools
  • Torrent Clients
  • Tutorial
  • Ubuntu
  • Udemy Courses
  • Uncategorized
  • VirtualBox
  • Virtualization
  • VMware
  • VPN
  • VSCode Editor
  • Web Browsers
  • Web Design
  • Web Hosting
  • Web Servers
  • Webmin
  • Windows
  • Windows Subsystem
  • WordPress
  • Zabbix
  • Zentyal
  • Zorin OS
Visits
  • 0
  • 256
  • 614,628

DesignLinux.com © All rights reserved

Go to mobile version