Centos7开启SSH连接配置

1、查看是否已安装openssh-server:

[root@localhost ~]# yum list installed | grep openssh-server

如果有信息说明已安装了openssh-server,如果输出没有任何结果,说明没有安装。

2、安装openssh-server(如果已安装,此处省略):

[root@localhost ~]# yum install openssh-server

3、编辑sshd_config:

[root@localhost ~]# vim /etc/ssh/sshd_config

放开端口以及监听地址,去掉#,如下图。

允许使用Root登录,如下图:

放开密码权限,如下图:

4、开启sshd服务:

[root@localhost ~]# sudo service sshd start

 查询 sshd  服务窗台:

[root@localhost ~]# ps -e | grep sshd

查询22端口是否已开启:

[root@localhost ~]# netstat -an | grep 22

5、设置开机启动:

[root@localhost ~]# systemctl enable sshd.service

6、查询当前系统的网络连接情况:

[root@localhost ~]# ifconfig

猜你喜欢

转载自blog.csdn.net/u012322399/article/details/128632359