无密码SSH SCP
一般执行:
Java代码
scp /home/daisy/full.tar.gz root@172.19.2.75:/home/root
执行后,提示输入serverB 172.19.2.75的root ssh密码。输入后就文件就copy过去了。
Linux系统下分发SCP无需密码配置ssh
在serverA上:
Java代码
#ssh-keygen -t rsa
#ls /root/.ssh
id_rsa id_rsa.pub known_hosts
#chmod 755 /root/.ssh
#chmod 600 /root/id_rsa
#scp id_rsa.pub serverB:/root/.ssh/authorized_keys
#scp aa.txt serverB:/root
以后无需密码了了。scp aa.txt serverB:/root
ssh-keygen -t rsa 时出现一推提示,直接回车
serverA上,chmod 755 /root/.ssh
serverA上,chmod 600 /root/id_rsa
ssh-copy-id
方法二:ssh-copy-id
方法三:
[code="code"]# ssh-keygen
# cat ~/.ssh/id_rsa.pub | ssh user@server "cat - >> ~/.ssh/authorized_keys"
补充:软件开发 , Java ,