MENU

centos7开启ssh服务

March 23, 2019 • Read: 989 • Server阅读设置

开启ssh服务需要root权限,先用root账户登陆

先检查有没有安装ssh服务:rpm -qa | grep ssh

如果没有安装ssh服务就安装 : yum install openssh-server

安装好后在ssh配置文件里进行配置 : vim /etc/ssh/sshd_config

用esc+:wq 保存退出

修改完后用 /bin/systemctl start sshd.service 开启ssh服务,这个命令没有回显

开启后用 ps -e | grep sshd 检查一下ssh服务是否开启

将ssh服务添加到自启动列表中:systemctl enable sshd.service

Last Modified: June 24, 2019