首页文章正文

给用户添加sudo权限,sudo切换root用户

服务器sudo权限 2023-05-26 17:20 852 墨鱼
服务器sudo权限

给用户添加sudo权限,sudo切换root用户

给用户添加sudo权限,sudo切换root用户

第一列:root,useraccount第二列:ALL,指的是logger的源主机第三列:ALL在括号中,指的是目标用户,即执行命令的人第四列:ALL,指的是commandnameExemptpasswordinputplusNOPASSWD:?2.1Addingasingleuser1:Createanewuserandsetapassword2:Addsudopermissionforanewuser3:删除用户的sudo权限1:创建一个新用户并设置密码$sudoadduser-mnewuser#Itwillcreateafolderwiththenameinthe/homedirectory$sudo

>0< §sudo配置文件是一个sudoers文件,它允许系统管理员集中管理用户权限和主机。 其存储位置默认为/etc/sudoers,并且该属性必须为0440.1]2.添加普通用户的sudo权限在stepcentos7中添加普通用户sudoersrootALL=(ALL)ALLadminALL=(ALL)NOPASSWD:ALL#此处需要添加的用户。上面这四个组成部分的含义是:系统的哪一个

?▂? 1.切换到rootuserauthorityLastlogin:TueSep2420:50:512013from192.168.30.171[user@Compile~]$surootpassword:[root@Compileuser]#2.View/etc/sudoersfilerightMethod1:Addausertothewheelgroup.WheelinCentOShassudoauthority#usermod-GwheeldbuserSwitchtothisuser#su-ldbuser[dbuser @cheery-boots-1~]$方法2(推荐)

test_userALL=(ALL:ALL)NOPASSWD:ALL#test_userneedstoprovidethepasswordoftest_usertousesudoafteradded,esctoexitediting,execute:wq,exitandsave. 此时,切换到test_user用户,执行需要root权限的命令,为该用户添加sudo权限。 一种方法是使用命令加入组成员:usermod-aGwheelyour_user_nameTheotheris修改配置文件vim/etc/groupbehindthewheelgroup

后台-插件-广告管理-内容页尾部广告(手机)

标签: sudo切换root用户

发表评论

评论列表

黑豹加速器 Copyright @ 2011-2022 All Rights Reserved. 版权所有 备案号:京ICP1234567-2号