让使用scp时不必输入密码


让使用scp时不必输入密码
 
让使用scp时不必输入密码,这样就可以在shell脚本中顺利地执行了:
me@local: ssh-keygen -t rsa
"/home/abc/.ssh/id_rsa_me"
生成:
"/home/abc/.ssh/id_rsa_me" 私钥
"/home/abc/.ssh/id_rsa_me.pub" 公钥(分发给目标服务器中所有的目标用户)
注意:要想不输入密码!就不要在上面输入密码!直接回车即可。
 
分发给目标服务器中某个目标用户:
me@local: cat ~/.ssh/id_rsa.pub | ssh you@remote 'cat >> ~/.ssh/authorized_keys'  
you@remote's password: 
 
 
然后,在本地me@local使用scp登录you@remote时就不必再输入密码了。
 
(done)
 

相关内容

    暂无相关文章