Fedora ssh服务,防火墙服务设置

时间:2021-12-06 06:57:50

Fedora26 ssh设置

ssh:connection to host 127,0.0.1 port22: Connection refused

  1. 首先安装openssh-server     yum install openssh-server

  2. systemctl start sshd.service

  • 查看服务状态:systemctl status sshd.service

 

  • 停止服务  systemctl start sshd.service  

 

 

  • 设置开机自启–方式1

    systemctl enable sshd.service 

 

  • 设置开机自启–方式2

    chkconfig --level 3 sshd on 
  • 停止开机自启动

    systemctl disable sshd.service

 

防火墙设置firewalld

开启firewall: systemctl start firewalld

查看状态:systemctl status firewalld  

停止:    systemctl disable firewalld

禁用:    systemctl stop firewalld

 

iptables:

  • 停止防火墙: service iptables stop
  • 启动防火墙: service iptables start