美文网首页
centos7 安装openssh

centos7 安装openssh

作者: 那个初衷 | 来源:发表于2017-08-22 13:16 被阅读0次

1.检查CentOS7是否安装了openssh-server

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

2.没有安装

执行yum install openssh-server 安装

[root@centos]# yum install openssh-server

3.如果已安装

找到/etc/ssh/目录下的sshd服务配置文件 sshd_config,用Vim编辑器打开
取消注释(去掉#)Post 22、PermitRootLogin(开启远程登陆) PasswordAuthentication(开启使用密码作为连接远征)

[root@centos]# vim /etc/ssh/sshd_config

4. 运行sshd服务

[root@centos]# service sshd start

5. 检查sshd服务状态

检查22号端口是否开启监听

[root@centos]# ps -e | grep sshd
# 或者
[root@centos]# netstat -an | grep 22

6. 连接测试

7. 设置开机启动

[root@centos]# systemctl enable sshd.service

相关文章

网友评论

      本文标题:centos7 安装openssh

      本文链接:https://www.haomeiwen.com/subject/pnfldxtx.html