centos 权限
环境:VMware下的CentOS
操作:
[shaon@localhost ~]$ sudo apt-get install samba <-----普通用户shaokn要进行sudo操作
[sudo] password for shaokn: <-----input passwd
shaokn is not in the sudoers file. This incident will be reported.
提示用户shaokn不在sudoers文件里.我们要做的就是把shaokn用户添加到sudoers文件里,怎么做呢?
1.进入超级用户模式.
[shaon@localhost ~]$ su -
Password: <-----input passwd
[root@localhost ~]# <-----root超级用户
2.添加sudoers文件写权限.
[root@localhost ~]# chmod u+w /etc/sudoers <-----注意sudoers文件路径
3.添加shaokn到sudoers文件里. 在"root ALL=(ALL) ALL"这行下添加"shaokn ALL=(ALL) ALL".
[root@localhost ~]# vim /etc/sudoers
.........................
.........................
root ALL=(ALL) ALL
shaokn ALL=(ALL) ALL <-----添加到这里. :wq保存退出
.........................
.........................
4.撤消sudoers写权限. 记得撤消写权限.
[root@localhost ~]# chmod u-w /etc/sudoers
相关推荐
加菲猫园 2013-06-16
pigsmall 2020-11-19
graseed 2020-10-28
大数据杂谈 2020-09-26
SXIAOYI 2020-09-16
jinhao 2020-09-07
ChinaWin 2020-08-13
mohanzb 2020-08-01
王国平 2020-06-20
yoohsummer 2020-06-01
kangtingting0 2020-05-20
MichelinMessi 2020-02-19
impress 2020-02-20
nicepainkiller 2020-01-25
hfszy0 2013-05-15
lizhenmxcz 2013-05-12
gxyblue 2013-05-11
chenshuixian 2013-06-01
羽化大刀Chrome 2013-05-31