---
title: "linux 新增用户及增加该用户sudo权限"
author: "qson"
date: "2014-04-26T09:39:55Z"
tags: []
categories: ["操作系统"]
slug: "linux-sudo"
draft: false
lastmod: "2014-11-18T16:19:43Z"
id: 2055525
url: "https://qson.iteye.com/blog/2055525"
---

**增加新用户，使用adduser命令：**

root@AY130925102139735305Z:/home# **sudo adduser xusongqin**
Adding user `xusongqin' ...
Adding new group `xusongqin' (1000) ...
Adding new user `xusongqin' (1000) with group `xusongqin' ...
Creating home directory `/home/xusongqin' ...
Copying files from `/etc/skel' ...
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
Changing the user information for xusongqin
Enter the new value, or press ENTER for the default
	Full Name : **xusongqin**
	Room Number : 
	Work Phone : 
	Home Phone : 
	Other : 
Is the information correct?  **Y**
root@AY130925102139735305Z:/home# **ls**
xusongqin

**为该用户增加sudo权限：**

root@AY130925102139735305Z:**vi /etc/sudoers ** 
##为用户添加sudo权限 xusongqin	ALL=(ALL:ALL) ALL

# User privilege specification
root	ALL=(ALL:ALL) ALL
**xusongqin	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: