Linux给普通用户添加root权限

原文地址:https://blog.csdn.net/hlx20080808/article/details/80027254

(1) 以root用户查看/etc/sudoers



(2)这个文件只读文件,将其更改成可写状态



(3)添加内容到文件内  

[root@hlx hadoop]# vi /etc/sudoers


(4)再将root用户文件改为只读

[root@hlx hadoop]# chmod 440 /etc/sudoers



(5)切换普通用户,就可以用sudo命令了

[root@hlx hadoop] # su hadoop 

[hadoop@hlx ~ ]$ sudo shutdown - h now    

重新启动OK!




[root@ltt2 bin]# su hadoop[hadoop@ltt2 bin]$ sudo shutdown - h now

猜你喜欢

转载自blog.csdn.net/tanga842428/article/details/80050032