linux开启ssh
1.查看是否安装了openssh-server
执行命令:
1 | yum list installed | grep openssh-server |
如果有openssh-server,则是已安装,如果没有则需要安装,执行安装命令:
1 | yum install openssh-server |
2.打开sshd配置文件sshd_config
执行命令:
1 | vim /etc/ssh/sshd_config |
去掉监听端口、地址前的注释:
开启远程登录:
开启用户密码作为连接验证,保存退出
3.开启 sshd 服务
执行命令:
1 | sudo service sshd start |
停止SSH服务命令:
1 | service sshd stop |
重启SSH服务命令:
1 | service sshd restart |
4.设置SSH服务为开机启动。
输入命令:
1 | chkconfig sshd on |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 惜缘怀古的博客!