Centos7开启ssh

1.安装openssh-server

首先检查是否已经安装了openssh-server

在终端输入

yum list installed | grep openssh-server

输出结果

openssh-server.x86_64                   7.4p1-16.el7                   @anaconda

如果未显示上面结果,则手动安装openssh-server,在终端如下命令进行安装

yum install openssh-server

2.修改配置信息

使用vim编辑器打开配置文件sshd_config

vim /etc/ssh/sshd_config

修改如下配置

Port 22  #端口号22
ListenAddress 0.0.0.0  #监听任意IPv4接入
ListenAddress ::  #监听任意IPv6接入
PermitRootLogin yes  #允许root管理员登陆
PasswordAuthentication yes  #开启密码认证

设置开机启动并启动ssh服务

systemctl enable sshd
systemctl start sshd

 

你可能感兴趣的:(Centos7)