In the Client machine, use the command below($ is the prompt):
1 $ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key ($HOME/.ssh/id_rsa): //here you can choose where put your key file
Enter passphrase (empty for no passphrase): //here just press enter
Enter same passphrase again: //press enter again
Your identification has been saved in $HOME/.ssh/id_rsa.
Your public key has been saved in $HOME/.ssh/id_rsa.pub.
The key fingerprint is:
31:bb:48:d6:f0:47:2b:25:a1:d6:00:bd:a4:0b:ff:84 lao@nc
The key's randomart image is:
+--[ RSA 2048]----+
| .o. . |
| o+ . |
| o+.= o |
| . ...+ B . |
| o oo S o |
| Eo.. + |
| o. . |
| . |
| |
+-----------------+
2 $ scp $HOME/.ssh/id_rsa.pub host:~/.ssh
3 $ ssh host //here you need enter your passwd
$ cat .ssh/id_rsa.put >> .ssh/authorized_keys
没有评论:
发表评论