1.在机器1中生成密钥
ssh-keygen -t rsa
2.在机器2中创建文件
vi authorized_keys
3.将生成的公钥id_rsa.pub拷贝到机器2中
/root/.ssh
4.加入授权
cat id_rsa.pub >>authorized_keys
5.修改authorized_keys文件的权限
chmod 400 authorized_keys
1.在机器1中生成密钥
ssh-keygen -t rsa
2.在机器2中创建文件
vi authorized_keys
3.将生成的公钥id_rsa.pub拷贝到机器2中
/root/.ssh
4.加入授权
cat id_rsa.pub >>authorized_keys
5.修改authorized_keys文件的权限
chmod 400 authorized_keys