|
Keys Authentication
|
| Configure SSH server to login with Keys Authentication. It is needed for it to make private key for client and public key for server. |
| [1] | Download 'puttygen.exe' from Putty's site. |
| [2] | Run 'puttygen.exe' and click 'Generate' button. |
|
| [3] | Move mouse untill progress bar will be full. |
|
| [4] | Set passphrase in 'Key passphrase' and 'Confirm passphrase'. Next, Click 'Save public key' and 'Save private key' and Save keys with a file name you want. |
|
| [5] | Open 'public_key' you saved. |
|
| Remove first line and last line and replace second line to 'ssh-rsa' and then remove all indention like follows. 'ssh-rsa xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==' |
|
|
| [6] | Login with a user and put 'public_key'. |
|
[cent@ns ~]$ mkdir .ssh [cent@ns ~]$ chmod 700 .ssh [cent@ns ~]$ cd .ssh [cent@ns .ssh]$ vi authorized_keys # Copy and Paste 'public_key'. ssh-rsa xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx== [cent@ns .ssh]$ chmod 600 authorized_keys [cent@ns .ssh]$ su - Password: [root@ns ~]# vi /etc/ssh/sshd_config # line 64: Change PasswordAuthentication no [root@ns ~]# /etc/rc.d/init.d/sshd restart Stopping sshd: [ OK ] Starting sshd: [ OK ]
|
| [7] | Run Putty and select 'private_key' like follows. |
|
| [8] | All OK, connect to the server with keys authentication. |
|