sudo yum install openssh*    安装

2. 设置 sudo vi /etc/ssh/sshd_config

首先先把port改掉
port 52222


限制用户
AllowUsers 使用者账号1 .....(添加进去)

取消注释
PermitEmptyPasswords no
PasswordAuthentication yes


限制root登陆

PermitRootLogin no

 


3. sudo systemctl restart sshd.service    重启服务



4. sudo systemctl enable sshd.service    开机启动

 

5. sudo firewall-cmd --permanent --zone=public --add-port=52041/tcp    修改防火墙,开放端口


6. sudo firewall-cmd --reload    重新读取配置

完成。


查看网络服务 netstat -antp 

相关文章:

  • 2021-12-21
  • 2021-11-23
  • 2021-09-15
  • 2022-12-23
  • 2022-12-23
  • 2021-09-28
猜你喜欢
  • 2021-11-23
  • 2021-12-03
  • 2021-12-03
  • 2021-06-12
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
相关资源
相似解决方案