Linux创建普通用户

声明:作者原创,转载注明出处。

作者:帅气陈吃苹果

1、创建用户,-m表示同时创建用户家目录

sudo useradd -m hadoop

2、为创建的hadoop用户设置密码

sudo passwd hadoop 

3、为hadoop用户添加对/etc/sudoers目录的写权限,默认只有root拥有只读权限

sudo chmod u+w /etc/sudoers

4、在/etc/sudoers文件中找到下面两句

#User privilege specification
root ALL=(ALL:ALL) ALL

在下面添加一行

hadoop ALL=(ALL:ALL) ALL

5、撤销文件的写权限

sudo chmod u-w /etc/sudoers

最后,欢迎指正。喜欢的话,点个赞呗,请你吃苹果。

原文地址:https://www.cnblogs.com/sqchen/p/8080947.html