您的位置:首页 > 其它

ssh无密码登录

2017-08-30 13:36 218 查看
生成ssh-keygen

>ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (~/.ssh/id_rsa):
~/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in ~/.ssh/id_rsa.
Your public key has been saved in ~/.ssh/id_rsa.pub.
The key fingerprint is:
03:5f:cd:46:00:53:85:f4:1d:b7:b7:5f:cd:56:43:5b cbs@localhost
The key's randomart image is:
+--[ RSA 2048]----+
|        o+++o ..E|
|         ..= ..o+|
|      .   . = .+o|
|       o . .   .*|
|        S      .=|
|         .     .o|
|                .|
|                 |
|                 |
+-----------------+


生成了公钥~/.ssh/id_rsa.pub 私钥~/.ssh/id_rsa

输入命令

ssh user@host "cat >>~/.ssh/authorized_keys" < ~/.ssh/id_rsa.pub


将公钥传递到远程主机,完成
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: