Ubuntu-10.10如何给用户添加sudo权限

Ubuntu-10.10系统安装过程中,系统会提示建立一个默认用户,比如用户名为:chen。
这个默认用户具有一定的管理功能,即可以通过sudo命令执行root权限的操作。由于Ubuntu系统不允许通过root用户登录系统,所以这个默认用户即是实际意义上的管理员。
现在的问题是:如果新建一个用户:zhao,然后要将此用户设置为与chen相同的管理员用户。
此问题有2种方式实现:
1.界面方式。
用chen登录系统,通过选择菜单:系统->系统管理->用户和组,选择zhao用户,更改账户类型为:管理员。然后重启电脑,用zhao用户登录即可。
2.命令行方式。
用chen登录系统,打开终端运行:
sudo gedit /etc/sudoers
修改此配置文件,修改后的/etc/sudoers文件的内容如下,其中最后一行为添加的zhao用户:


# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#

Defaults env_reset

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root ALL=(ALL) ALL

# Allow members of group sudo to execute any command
# (Note that later entries override this, so you might need to move
# it further down)
%sudo ALL=(ALL) ALL
#
#includedir /etc/sudoers.d

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
zhao ALL=(ALL) ALL


然后重启电脑,用zhao用户登录即可。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值