General execution:
Java code
Scp/home/daisy/full.tar.gz root@172.19.2.75:/home/root
After the command is executed, enter the root ssh password of server B 172.19.2.75. After the input, the file is copied.
Password-free ssh configuration is not required for distributing SCP in Linux
On serverA:
Java code
# 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
No Password is required in the future. Scp aa.txt serverB:/root
When ssh-keygen-t rsa is pushed, press Enter.
On serverA, chmod 755/root/. ssh
On serverA, chmod 600/root/id_rsa
Ssh-copy-id
Method 2: ssh-copy-id
Method 3:
[Code = & quot; code & quot;] # ssh-keygen
# Cat ~ /. Ssh/id_rsa.pub | ssh user @ server & quot; cat-& gt ;~ /. Ssh/authorized_keys & quot;