1.安裝openssh和openssh-server
dnf -y install openssh
dnf -y install openssh-server
2.卸載openssh和openssh-server
dnf -y remove openssh
dnf -y remove openssh-server
3.允許root通過 SSH 登錄看扶平,如果禁止root遠(yuǎn)程登錄奔害,那就設(shè)置為 no :
PermitRootLogin yes
4.啟動sshd服務(wù)
service sshd start
ps -ef | grep sshd
5.設(shè)置系統(tǒng)開機(jī)自啟openssh-server,開啟openssh-server
systemctl enable sshd
systemctl start sshd
systemctl status sshd
systemctl list-unit-files | grep sshd
6.查詢centos服務(wù)ip使用登錄密碼測試遠(yuǎn)程鏈接
ssh -p 端口 用戶@centos服務(wù)ip