新建用户,设置密码

useradd eason     

passwd eason

不允许root直接登陆

修改配置文件

vi /etc/ssh/sshd_config

禁止root登录

查找“#PermitRootLogin yes”,将前面的“#”去掉,短尾“yes”改为“no”,并保存文件。

修改默认端口号

找到#Port 22字段删掉#,将22改为其他不被使用的端口

服务器端口最大可以开到65536

配置普通用户超级权限

vim   /etc/sudoers

 

Ssh safe

重启SSH服务

systemctl restart firewalld

/etc/init.d/sshd restart

service restart sshd

SSH登录格式

ssh  -p 34567 user@ip

相关文章:

  • 2021-11-27
  • 2021-08-18
  • 2021-09-09
  • 2022-12-23
  • 2021-11-16
  • 2021-09-18
  • 2022-12-23
  • 2021-12-03
猜你喜欢
  • 2022-12-23
  • 2021-07-24
  • 2022-12-23
  • 2022-12-23
  • 2021-05-06
  • 2021-11-19
  • 2022-12-23
相关资源
相似解决方案