设置ssh证书登录,禁止root登录,禁止su到root,sudo权限设置

一、设置ssh证书登录,禁止root登录

创新互联专注为客户提供全方位的互联网综合服务,包含不限于成都做网站、成都网站设计、平武网络推广、微信小程序、平武网络营销、平武企业策划、平武品牌公关、搜索引擎seo、人物专访、企业宣传片、企业代运营等,从售前售中售后,我们都将竭诚为您服务,您的肯定,是我们最大的嘉奖;创新互联为所有大学生创业者提供平武建站搭建服务,24小时服务热线:13518219792,官方网址:www.cdcxhl.com

useradd newuser
passwd newuser

vim /etc/ssh/sshd_config

PermitRootLogin no
RSAAuthentication yes
PubkeyAuthentication yes
PasswordAuthentication no
ClientAliveInterval 30
ClientAliveCountMax 5

二、禁止su

vim /etc/pam.d/su
auth            required        pam_wheel.so use_uid

vim /etc/login.defs
SU_WHEEL_ONLY yes

三、sudo权限设置

chmod 640 /etc/sudoers
vim /etc/sudoers
lity    ALL=(ALL)       ALL
chmod 440 /etc/sudoers

网页题目:设置ssh证书登录,禁止root登录,禁止su到root,sudo权限设置
当前网址:http://scyanting.com/article/pspgjp.html