linux服務ssh詳解
ssh服務:
管理服務器的方式:
本地管理 (安裝系統、故障修復)
SSH遠程連接的方式
Linux: ssh命令
Windows:
Xshell; Xmanager
SecureCRT
Putty
提供ssh服務/ssh客戶端工具的軟件:
[[email protected] ~]# rpm -qa | grep ssh
openssh-server-6.6.1p1-33.el7_3.x86_64
openssh-clients-6.6.1p1-33.el7_3.x86_64
[[email protected] ~]# systemctl status sshd ------>查狀態
[[email protected] ~]# ss -antp | grep sshd
LISTEN 0 128 *:22 *:* users:(("sshd",pid=1202,fd=3))
1、遠程連接主機
# ssh [user@]host
# ssh 192.168.87.10
# ssh [email protected]
2、遠程連接主機執行命令
# ssh 192.168.87.10 ‘hostname‘
[[email protected]
3、遠程復制文件的工具
scp, rsync (增量復制)
[[email protected] ~]# scp /etc/fstab 192.168.122.121:/tmp/
[[email protected] ~]# scp 192.168.122.121:/etc/passwd /tmp/
-r:復制目錄
rsync
[[email protected] ~]# rsync -av /bj/ 192.168.122.121:/sh
[[email protected]