禁止root直接登陆linux系统
直接修改文件
# vim /etc/ssh/sshd_config
SyslogFacility AUTHPRIV PermitRootLogin no RSAAuthentication yes PubkeyAuthentication yes AuthorizedKeysFile .ssh/authorized_keys PasswordAuthentication no ChallengeResponseAuthentication no GSSAPIAuthentication yes GSSAPICleanupCredentials yes UsePAM yes X11Forwarding yes Subsystem sftp /usr/libexec/openssh/sftp-server
/etc/init.d/sshd restart
如何免密码切换到root呢?
vim /etc/sudoers
【普通账号】 ALL=(ALL) NOPASSWD: ALL
保存之后,回到普通用户直接输入sudo -s即可免密切换到root账号
好了,到这里就结束了,喜欢我的博客作品,那就请关注我吧,如果对博客文章有更好的建议或者技术疑问欢迎在下方评论区留言,也可以在左侧找我的联系方式和QQ群进行交流互动,感谢大家的支持
PS:技术文章为原创作品,未经允许,请勿转载,如果转发分享,请标明出处