SSH & SCP no Password

如何在脚本中使用SSH或者SCP 的过程中免去输入密码的麻烦?

步骤如下:

1:在本地机器上生成公钥

 ssh-keygen -t dsa

         2:将步骤1生成的公钥拷贝到目标机器(远程机器、要连接的机器)

 ssh-copy-id -i ~/.ssh/id_dsa.pub user@remotexx

      如果步骤失败,可以手段拷贝公钥文件中的内容到目标机的authorized_keys文件中

详情见如下链接:

http://hostingrails.com/HowTo-SSH-SCP-without-a-password

猜你喜欢

转载自movenut.iteye.com/blog/1216821