Because the work needs, often from the Windows host to access the remote Ubuntu server, each input account and the old password, feel very troublesome, so the reference online tutorial simple set up can automatically login remote host, very convenient.
Although Putty also provides puttygen.exe generate public/secret key, but and Linux host generated key format is different, need to manually modify the format, so the Linux host the way they generate the key.
First login to the Linux host, the specific process is as follows:
1. Generate public keys and keys
Copy Code code as follows:
verdana@hostname:~$ ssh-keygen-t RSA
Generating public/private RSA key pair.
Enter file in which to save the key (/HOME/VERDANA/.SSH/ID_RSA):
Enter passphrase (empty for no passphrase):
Enter same Passphrase again:
Your identification has been saved In/home/verdana/.ssh/id_rsa.
Your public key has been saved in/home/verdana/.ssh/id_rsa.pub.
The key fingerprint is:
51:51:DA:44:28:B5:83:DE:D2:1E:60:4F:81:C9:F1:1A verdana@hostname.com
Note Passphrase blank.
2. Append public key content to Authorized_keys
Copy Code code as follows:
# If Authorized_keys already exist, skip touch Create file This step
verdana@hostname:~/.ssh$ Touch Authorized_keys
verdana@hostname:~/.ssh$ Cat Id_rsa.pub >> Authorized_keys
3. Download the key and convert it to Putty recognizable format
Putty does not recognize the key generated by the Linux host, so it needs to be converted with Puttygen.exe.
A) Use FTP software or other means to copy the generated key ID_RSA to the client host, where my client is a Vista system
b) Open Puttygen.exe, click on the menu: Conversion-> Import key-> save key (such as: ID_RSA.PPK), the key is converted to complete, here is not set password protection
4. Set Putty
Open Putty
A) session, host name fill in: User@remote-host,user is your Linux host login name, Remote-host is the IP or remote host domain name, such as: Root@phpvim.net.
B Connect->ssh-> Authentication-> Browse, select the key (ID_RSA.PPK) that you just converted, and then save the session.
5. Use Cygwin?
If you are using a Cygwin SSH login remote server, simply copy the 3rd step generated key Id_rsa (no conversion required) to the Cygwin user's. SSH directory.