1.检查是否安装ssh
linux大部分都是默认安装SSH,检查是否安装命令
[root@somnus ~]# rpm -qa |grep ssh
libssh-0.9.6-3.al8.x86_64
openssh-8.0p1-16.0.1.al8.x86_64
openssh-server-8.0p1-16.0.1.al8.x86_64
libssh-config-0.9.6-3.al8.noarch
openssh-clients-8.0p1-16.0.1.al8.x86_64
sshpass-1.09-4.al8.x86_64
[root@somnus ~]#
如果没有安装,使用命令进行安装
yum install -y openssh-server
2.ssh配置文件sshd_config
linux大部分系统默认路径/etc/ssh/sshd_config;
找到#Port 22 端口
3.修改端口
删除#,并修改端口22为其他端口,如4567端口
4.重启SSH
systemctl restart sshd.service
5.验证登陆
ip具体地址
ssh -p 4567 root@ip