使ssh/scp不用输入密码
Pubdate:2009-09-15 13:12:00 Categories: 1568 Views第一步:在本地生成密匙对,我用的是rsa的密钥。使用命令 "ssh-keygen -t rsa" ssh-keygen -t rsa 然后敲三个回车
其中公共密钥保存在 ~/.ssh/id_rsa.pub
私有密钥保存在 ~/.ssh/id_rsa
之后把这个密钥对中的公共密钥复制到你要访问的机器上去。
$ scp ~/.ssh/id_rsa.pub username@远程机器IP:/home/username/.ssh/
并追加到~/.ssh/authorized_keys.
$ cat ~/.ssh/id_rsa.pub>>~/.ssh/authorized_keys
Comments(0)