The authenticity of host ‘[10.69.112.78]:21987 ([10.69.112.78]:21987)‘ can‘t be established.
RSA key fingerprint is ae:b5:46:d4:ef:f0:82:3d:ab:0d:dd:59:9c:70:38:92.
Warning: Permanently added ‘[10.69.112.78]:21987‘ (RSA) to the list of known hosts.
eth2 Link encap:Ethernet HWaddr 92:D5:6C:92:BA:C0
inet addr:10.69.112.78 Bcast:10.69.112.255 Mask:255.255.255.0
inet6 addr: fe80::90d5:6cff:fe92:bac0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:234774 errors:0 dropped:0 overruns:0 frame:0
TX packets:196553 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:27878853 (26.5 MiB) TX bytes:15731641 (15.0 MiB)
ssh小结
1 切换到别的机器上 ssh -p21987 user@ip
2 到其他机器上执行命令(不会切到机器上)ssh -p21987 user@ip 命令(全路径)
3 当第一次ssh连接的时候,本地会产生一个密钥文件~/.ssh/known_hosts
ssh配置文件优化:
Port 21987
Protocol 2
SyslogFacility AUTHPRIV
PermitRootLogin no
PasswordAuthentication yes
ChallengeResponseAuthentication no
GSSAPIAuthentication no
GSSAPICleanupCredentials yes
UsePAM yes
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE
AcceptEnv XMODIFIERS
X11Forwarding yes
UseDNS no
Subsystem sftp /usr/libexec/openssh/sftp-server
-r 递归
-p保持属性
批量分发
Connecting to 10.69.112.78...
sftp> put /etc/passwd
Uploading /etc/passwd to /home/hp/passwd
/etc/passwd 100% 1072 1.1KB/s 00:00
scp小结:
1 scp是加密的远程拷贝,而cp仅为本地拷贝
2 可以把数据从一台机器推送到另一台机器,也可以从其他服务器把数据拉回来
3 每次都是全量完整拷贝,效率不高,适合第一次拷贝,如果需要增量拷贝,用rsync
Generating public/private dsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_dsa.
Your public key has been saved in /root/.ssh/id_dsa.pub.
The key fingerprint is:
The key‘s randomart image is:
+--[ DSA 1024]----+
| o=+.... . B.|
| oo .o o o B|
| .. . . . ..|
| o.. .|
| . .S. E|
| o. |
| ... |
| . . |
| .. |
+-----------------+