Sunday, March 29, 2020

putty ssh passwordless login

SSH server is already configured with openssh on Linux. From Windows machine Putty application.  Go to 'All Programs' -> Putty -> PuttyGen.  Click Generate.  It will take few seconds to generate a set of private and public keys. Save them individually.


Copy the 'user-public' file to ssh server machine and append the contents to 'authorized_keys' file

1
2
3
4
5
# ssh-keygen -i -f user-public 
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAnVjU8ymO2p8ZMxjWjiBSDvBLyqENwUQQq4KYotJMUQtSOc08kvGvnuS3Y3ZsJyMJpVcq803v7dPiec0IVqaqo5uLPrpKtLDz5pqHHS3GmQnvkvBoHRxLgR89I0EQWHvJ+cAt1Hfa2GNTSAG3Qc30hRWlkWZrm/Wg5JasvmgBtRsp4WTBwrAH2EkGTC7NL2aoDNZ+IF0zElHGUoSB2a4PU17Tbh2paEIb2+ISCn2Wd0PFJGzFNcgLcO7exNc6OsBZRfz8Iltvt/Hc+64ORDVi1ck23WMI2A/VfePdmq6Yf/iL5c96wPg2vCCjGQghGfytuwPo7BFCOGibwU5yBhuy8Q==

# ssh-keygen -i -f user-public >> ~/.ssh/authorized_keys
#

On the client, machine we have to create a new profile and link 'user-private.ppk' file to the profile.





From Windows machine, you can open the putty application, select the IP address from the 'Saved Sessions', 'Load' and 'Open'.  You will get the prompt in the ssh session.

Thanks

No comments:

Post a Comment