A想通过免密码登录B
1. 生成密钥
在A上执行:
ssh-keygen -t rsa -P ''
2. 将A的公钥传到B上
scp ~/.ssh/id_rsa.pub xxx@ip:~/
3. 在B中执行
cd ~
cat id_rsa.pub >> .ssh/authorized_keys
chmod 600 .ssh/authorized_keys
A想通过免密码登录B
1. 生成密钥
在A上执行:
ssh-keygen -t rsa -P ''
2. 将A的公钥传到B上
scp ~/.ssh/id_rsa.pub xxx@ip:~/
3. 在B中执行
cd ~
cat id_rsa.pub >> .ssh/authorized_keys
chmod 600 .ssh/authorized_keys