rcp, scp, rexec 等命令很方便,rcp 建立信任主机(即$HOME/.rhosts)配置即可,scp需要秘钥
下面配置scp秘钥的过程,可以在不同机器之间互相拷贝
<1762 hostname [currentuser] :/home/currentuser>ssh-keygen -b 1024 -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/currentuser/.ssh/id_rsa): Enter
Created directory '/home/currentuser/.ssh'.
Enter passphrase (empty for no passphrase): Enter
Enter same passphrase again: Enter
Your identification has been saved in /home/currentuser/.ssh/id_rsa.
Your public key has been saved in /home/currentuser/.ssh/id_rsa.pub.
The key fingerprint is:
44:05:90:b0:34:07:6d:61:29:6d:ee:33:39:35:fa:25 currentuser@hostname
<1763 hostname [currentuser] :/home/currentuser>
<1763 hostname [currentuser] :/home/currentuser>cd .ssh
<1764 hostname [currentuser] :/home/currentuser/.ssh>ls
id_rsa id_rsa.pub
<1765 hostname [currentuser] :/home/currentuser/.ssh>scp id_rsa.pub xxx.xxx.xxx.xxx:/home/currentuser/.ssh/authorized_keys
The authenticity of host 'xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx)' can't be established.
RSA key fingerprint is 59:f9:b7:2a:94:ba:bd:6b:05:4a:40:c0:e9:1e:74:23.
Are you sure you want to continue connecting (yes/no)?yes
Warning: Permanently added 'xxx.xxx.xxx.xxx' (RSA) to the list of known hosts.
currentuser@xxx.xxx.xxx.xxx's password:
id_rsa.pub 100% 220 0.2KB/s 00:00
<1766 hostname [currentuser] :/home/currentuser/.ssh>ls
id_rsa id_rsa.pub known_hosts
<1767 hostname [currentuser] :/home/currentuser/.ssh>ls -lrt
total 24
-rw-r--r-- 1 currentuser currentgroup 220 Jul 25 16:12 id_rsa.pub
-rw------- 1 currentuser currentgroup 887 Jul 25 16:12 id_rsa
-rw-r--r-- 1 currentuser currentgroup 393 Jul 25 16:12 known_hosts
<1768 hostname [currentuser] :/home/currentuser/.ssh>cd ..
<1771 hostname [currentuser] :/home/currentuser/userfile/lc>scp mylist xxx.xxx.xxx.xxx:/home/currentuser/userfile/
mylist 100% 13 0.0KB/s 00:00