hoctinhoc |
04-10-2009 09:26 AM |
Keys Authentication!
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]
Login as a user you'd like to configure for Keys Authentication.
Trích dẫn:
[cent@ns ~]$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/cent/.ssh/id_rsa):
Created directory '/home/cent/.ssh'.
Enter passphrase (empty for no passphrase): // set any password you like
Enter same passphrase again: // verify
Your identification has been saved in /home/cent/.ssh/id_rsa.
Your public key has been saved in /home/cent/.ssh/id_rsa.pub.
The key fingerprint is:
e0:f7:97:60:a4:06:27:81:42:5b:69:e2:54:50:7b:50 info@quantrinet.com
[cent@ns ~]$ cd .ssh
[cent@ns .ssh]$ mv id_rsa.pub authorized_keys
[cent@ns .ssh]$ chmod 600 authorized_keys
[cent@ns .ssh]$ vi id_rsa
// Copy all in this file like below and Paste into a file on Windows client computer.
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
*******************************
*******************************
-----END RSA PRIVATE KEY-----
[cent@ns .ssh]$ su -
Password:
[root@ns ~]# vi /etc/ssh/sshd_config
PasswordAuthentication no // line 60: change to 'no'
[root@ns ~]# /etc/rc.d/init.d/sshd restart
|
[2] Download PuTTYgen and start it on Windows client computer. And next, Click [File]-[Load private key] like below. Then, Choose a file which is private key that you made in section [1]
http://server-world.info/en/CentOS_5/ssh/img/3.jpg
[3] You need to answer with passphrase for private key which you set in section [1].
http://server-world.info/en/CentOS_5/ssh/img/4.jpg
[4] Click the button 'Save private key' and Save it in any place you like on your computer.
http://server-world.info/en/CentOS_5/ssh/img/5.jpg
[5] Start putty and move to 'Auth' section like below. next, Select the private key you saved in previous section.
http://server-world.info/en/CentOS_5/ssh/img/6.jpg
[6] Back to the 'Session' section and input server's IP address to login.
http://server-world.info/en/CentOS_5/ssh/img/1.jpg
:battay:
|