mtma

centos7开启ssh服务

Xshell下载方式 请参考:https://blog.csdn.net/weixin_40928253/article/details/80621724

xshell使用教程请参考:https://blog.csdn.net/Hanani_Jia/article/details/78732033

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

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

 

 

 

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

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

 

 

 

 

 

 

 

记得把里面这三项给搞定。 

 

重启SSH服务systemctl restart sshd

 

用esc+ :wq 保存退出

 

 

 

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

 

 

 

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

 

再用netstat -an | grep 22检查一下22端口是否开启

 

 

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

 

 

 

关闭防火墙:

systemctl stop firewalld

禁止开机启动:

systemctl disable firewalld

 

关闭SE Linux

setenforce 0  #这是临时关闭

setenforce 1  #这是开启

 

posted on 2020-03-15 15:44  MTMA  阅读(308)  评论(0编辑  收藏  举报
 

分类:

技术点:

相关文章:

  • 2021-12-20
  • 2022-01-05
  • 2021-11-23
  • 2022-02-07
  • 2021-11-23
猜你喜欢
  • 2022-01-05
  • 2022-01-05
  • 2022-01-05
相关资源
相似解决方案