SSH是一種安全通道協議,主要用來實現字符界面的遠程登錄、遠程復制等功能。SSH協議對通信雙方的數據傳輸進行了加密處理,其中包括用戶登錄時輸入的用戶口令。與早期的telnet、rsh、rcp等應用相比,SSH協議提供了更好的安全性。
#Port 22 //端口號#AddressFamily any #ListenAddress 0.0.0.0 //ipv4監聽地址#ListenAddress :: //ipv6監聽地址
#LoginGraceTime 2m //會話時間#PermitRootLogin yes //是否進制root登錄#StrictModes yes //是否驗證訪問權限#MaxAuthTries 6 //驗證次數6次#MaxSessions 10 //訪問的最大鏈接數#PubkeyAuthentication yes //是否驗證公鑰
在VMware 15中打開兩天Linux系統,一臺用作主服務器(tast01IP地址:192.168.144.133),一臺用作遠程終端(tast02IP地址:192.168.144.135),使用SSH協議登錄主服務器
1、在tast01中進入SSH主服務器配置文件,更改配置文件條目,開啟SSH服務。
[root@tast01 ~]# vim /etc/ssh/sshd_config //進入編輯服務器配置文件信息Port 22 //開啟端口#AddressFamily any#ListenAddress 0.0.0.0#ListenAddress :::wq //保存退出[root@tast01 ~]# systemctl restart sshd //重啟SSH服務
2、在tast02中使用SSH服務登錄tast01。
[root@tast02 ~]# ssh root@192.168.144.133 //使用SSH服務登錄tast01服務器The authenticity of host '192.168.144.133 (192.168.144.133)' can't be established.ECDSA key fingerprint is SHA256:B8IsZOFG7FbtVkIK+dMILmo0iA4OEIeVGY0GnnCbXhk.ECDSA key fingerprint is MD5:c2:d8:09:17:de:6e:ec:07:06:1b:ac:b6:1e:bd:62:09.Are you sure you want to continue connecting (yes/no)? yes //詢問是否建立會話Warning: Permanently added '192.168.144.133' (ECDSA) to the list of known hosts.root@192.168.144.133's password: //輸入密碼Last login: Mon Sep 9 13:59:09 2019[root@tast01 ~]# //成功登錄tast01[root@tast01 ~]# exit //退出登出Connection to 192.168.144.133 closed.[root@tast02 ~]# //回到tast02端口
新聞熱點
疑難解答