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远程登录,那就设置为 no :
PermitRootLogin yes
4.启动sshd服务
service sshd start
ps -ef | grep sshd
5.设置系统开机自启openssh-server,开启openssh-server
systemctl enable sshd
systemctl start sshd
systemctl status sshd
systemctl list-unit-files | grep sshd
6.查询centos服务ip使用登录密码测试远程链接
ssh -p 端口 用户@centos服务ip