First, at least two servers, one sent to do, a do accept the
add a user to add a password 123456 oldboy
created on the A key pair: ssh-keygen -t (algorithm specified key) dsa type (key, there rsa) default is rsa
then has a carriage return
and then view
[oldboy@A ~]$ ll ~/ -al total 32 drwx------ 5 oldboy oldboy 4096 Sep 6 21:31 . drwxr-xr-x. 5 root root 4096 Sep 6 21:22 .. -rw-r--r-- 1 oldboy oldboy 18 Oct 16 2014 .bash_logout -rw-r--r-- 1 oldboy oldboy 176 Oct 16 2014 .bash_profile -rw-r--r-- 1 oldboy oldboy 124 Oct 16 2014 .bashrc drwxr-xr-x 2 oldboy oldboy 4096 Nov 11 2010 .gnome2 drwxr-xr-x 4 oldboy oldboy 4096 Aug 8 03:07 .mozilla drwx------ 2 oldboy oldboy 4096 Sep 6 21:32 .ssh [oldboy@A ~]$ ls -l .ssh/ total 8 ------- 668. 1 Oldboy Oldboy -rw On Sep 21:32. 6 id_dsa (private) -rw-R & lt - r--. 1 Oldboy Oldboy 598 id_dsa.pub On Sep 21:32. 6 (public)
Distribute a public key: a method for
the default port distribution: ssh-copy-id -i .ssh / id_dsa.pub [email protected]
designated port distribution: ssh-copy-id -i .ssh / id_dsa.pub "-p 52113oldboy @ 192.168.157.139 "
method two: to specify the port by modifying the script ssh-copy-id, so you can not specify the port in the command line
to view the transmission result:
[Oldboy @ ~ B] $ LL .ssh / Total . 4 -rw ------- 598. 1 Oldboy Oldboy On Sep 21:46. 6 the authorized_keys Test: [Oldboy @ A ~] $ SSH -p22 [email protected] ( found that direct landing)
Then bursting:
write a script file to distribute commands to write for example: scp -p22 a.txt [email protected]: ~