您的位置:首页 > 运维架构 > Linux

linux(ubuntu) 创建一个名为hadoop的用户和用户组

2016-02-25 22:56 465 查看
写在前面:无论怎么确认,还是泪奔了,同一个账号以前的东西消失了,虽然不多,如同丢失了心爱的东西。

步骤:

1. 创建名为hadoop用户组

sudo addgroup hadoop

2. 创建名为hadoop的用户

sudo adduser --ingroup hadoop hadoop

直接一路回车

3. sudo gedit /etc/sudoers

为了让hadoop使用sudo命令,修改该文件,在root ALL=(ALL:ALL) ALL下面添加一行:

hadoop ALL=(ALL:ALL) ALL

原文件备份:

#

# This file MUST be edited with the 'visudo' command as root.

#

# Please consider adding local content in /etc/sudoers.d/ instead of

# directly modifying this file.

#

# See the man page for details on how to write a sudoers file.

#

Defaults    env_reset

Defaults    mail_badpass

Defaults    secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification

root    ALL=(ALL:ALL) ALL

(应在此处添加修改)

# Members of the admin group may gain root privileges

%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command

%sudo    ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d

参考链接:
http://blog.sina.com.cn/s/blog_6754000a01019zhl.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: