SSH安全

新建用戶,設置密碼

useradd eason     vim

passwd eason服務器

不容許root直接登錄

修改配置文件

vi /etc/ssh/sshd_configssh

禁止root登陸

查找「#PermitRootLogin yes」,將前面的「#」去掉,短尾「yes」改成「no」,並保存文件。3d

修改默認端口號

找到#Port 22字段刪掉#,將22改成其餘不被使用的端口rest

服務器端口最大能夠開到65536blog

配置普通用戶超級權限

vim   /etc/sudoersip

 

重啓SSH服務

systemctl restart firewalldit

/etc/init.d/sshd restartio

service restart sshdclass

SSH登陸格式

ssh  -p 34567 user@ip

相關文章
相關標籤/搜索