This is the most common requirement, I have ever needed. I hope this will help other as well.
Basically here, I am going to show you steps for connecting Linux machine from windows using putty. This is key based authetication not with password.
So first login into linux machine and run below command.
[demouser@ip-10-36-100-23 ~]$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/demouser/.ssh/id_rsa):
Created directory '/home/demouser/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/demouser/.ssh/id_rsa.
Your public key has been saved in /home/demouser/.ssh/id_rsa.pub.
The key fingerprint is:
6f:e1:0d:97:fb:82:b0:2c:48:fc:e4:50:1b:a1:7c:70 demouser@ip-10-36-100-23
[demouser@ip-10-36-100-23 ~]$
Now go to .ssh directory and add id_rsa.pub content into authorized_keys file.
[demouser@ip-10-36-100-23 .ssh]$ cd .ssh
[demouser@ip-10-36-100-23 .ssh]$ cat id_rsa.pub >> authorized_keys
Now change permission of all files in /home/demouser/.ssh directory.
[demouser@ip-10-36-100-23 .ssh]$ chmod 600 *
Now copy content of "id_rsa" file and paste it in notepad and save it with demouser.ppk in windows. Now download "puttygen". Open Puttygen and click on Load button, load demouser.ppk file. and click on "Save Private Key". Do not give any password to protect private key. Save the new key.
You can utilize that new key to login into linux server using putty without password based authentication.
No comments:
Post a Comment