centos7.5开启ssh服务

1,查看是否已安装openssh-server;

指令:rpm -qa | grep ssh

centos7.5开启ssh服务_第1张图片

2,如果未安装,请先安装openssh-server

yum install openssh-server

3,编辑ssh参数:vim /etc/ssh/sshd_config

centos7.5开启ssh服务_第2张图片

修改端口号

centos7.5开启ssh服务_第3张图片

允许root登录

设置需要密码登录

修改好后输入“:wqa”保存退出

4,开启ssh服务:systemctl start sshd.service

5,设置开机启动:systemctl enable sshd.service

6,检查ssh服务是否已开启:

ps -e|grep sshd

7,检查端口是否已被监听:

netstat -an|grep 22

如还不能访问,请在防火墙中添加端口

 

你可能感兴趣的:(linux操作系统)