ubuntu创建sudo 用户
The sudo
command provides a mechanism for granting administrator privileges, ordinarily only available to the root user, to normal users. This guide will show you the easiest way to create a new user with sudo access on Ubuntu, without having to modify your server's sudoers
file. If you want to configure sudo for an existing user, simply skip to step 3.
Steps to Create a New Sudo User
Log in to your server as the
root
user.- ssh root@server_ip_address
Use the
adduser
command to add a new user to your system.Be sure to replace username with the user that you want to create.
- adduser username
Set and confirm the new user's password at the prompt. A strong password is highly recommended!
Set password prompts:Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Follow the prompts to set the new user's information. It is fine to accept the defaults to leave all of this information blank.
User information prompts:Changing the user information for username
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n]
Use the
usermod
command to add the user to thesudo
group.- usermod -aG sudo username
By default, on Ubuntu, members of the
sudo
group have sudo privileges.Test sudo access on new user account
Use the
su
command to switch to the new user account.- su - username
As the new user, verify that you can use sudo by prepending "sudo" to the command that you want to run with superuser privileges.
- sudo command_to_run
For example, you can list the contents of the
/root
directory, which is normally only accessible to the root user.- sudo ls -la /root
The first time you use
sudo
in a session, you will be prompted for the password of the user account. Enter the password to proceed.Output:[sudo] password for username:
If your user is in the proper group and you entered the password correctly, the command that you issued with sudo should run with root privileges.
ubuntu创建sudo 用户的更多相关文章
- Ubuntu创建新用户的正确姿势
作者按:因为教程所示图片使用的是 github 仓库图片,网速过慢的朋友请移步<Ubuntu 创建新用户的正确姿势>原文地址.更欢迎来我的小站看更多原创内容:godbmw.com,进行&q ...
- Ubuntu创建新用户并增加管理员权限(授权有问题)
转自:Ubuntu创建新用户并增加管理员权限 $是普通管员,#是系统管理员,在Ubuntu下,root用户默认是没有密码的,因此也就无法使用(据说是为了安全).想用root的话,得给root用户设置一 ...
- ubuntu创建新用户
ubuntu和windows一样,可以任意创建或者删除新的用户,windows下比较简单,ubuntu下需要使用命令,不过操作起来不是很繁琐,所以我尽量写的详细一些. 如何创建ubuntu新用户? ...
- Ubuntu创建新用户并设置权限
打开终端开启root账户 sudo passwd -u root 设置root密码,输入两次 sudo passwd root 切换root账号 su - 或 su root 退出root账户使用ex ...
- Ubuntu创建新用户并增加管理员权限
1.Ubuntu中的root帐号默认是被禁用了的,所以登陆的时候没有这个账号 打开终端开启root账户 sudo passwd -u root sudo passwd root 设置root密码,输入 ...
- Ubuntu 添加sudo用户
第一种方法: 添加sudo用户 当你安装Ubuntu的时候,它会自动添加第一个用户到sudo组,允许这个用户通过键入其自身帐户密 码来获得超级用户(root)身份.然而,系统不会再自动添加其他的用户到 ...
- adduser Ubuntu添加sudo用户
第一种方法: 添加sudo用户 当你安装Ubuntu的时候,它会自动添加第一个用户到sudo组,允许这个用户通过键入其自身帐户密码来获得超级用户(root)身份.然而,系统不会再自动添加其他的用户到s ...
- Ubuntu在没用root权限下如何创建sudo用户
起因 安装openCryptoki之后,如果想执行相关命令的话,那么该用户必须在pkcs11用户组中,于是执行 sudo uersmod -G pkcs11 $(whoami) 之后重启系统,执行 s ...
- (转载)ubuntu创建新用户并增加管…
问题导读: 1.adduser与useradd有什么区别? 2.那种方式会自动创建组.用户组等信息? 3.如何新建用户具有管理员权限? $是普通管员,#是系统管理员,在Ubuntu下,root用户默认 ...
随机推荐
- AC日记——[USACO10MAR]仓配置Barn Allocation 洛谷 P1937
[USACO10MAR]仓配置Barn Allocation 思路: 贪心+线段树维护: 代码: #include <bits/stdc++.h> using namespace std; ...
- 处理form表单提交后返回值的处理办法【html5】
同事朋友ajax,最近在弄公司业务电话机,自主搭建,买的设备. 其中最主要功能是前端发起呼叫,通过浏览器触发设备进行呼叫功能,走后台呼叫还不行. 需求是这样的: 前端给设备ip发送特定的一段xml信息 ...
- bzoj1030 AC自动机+dp
思路:建状态图,在状态图上dp. #include<bits/stdc++.h> #define LL long long #define ll long long #define fi ...
- 51nod 1295 XOR key-区间异或最大值-可持久化01Trie树(模板)
1295 XOR key 2 秒 262,144 KB 160 分 6 级题 给出一个长度为N的正整数数组A,再给出Q个查询,每个查询包括3个数,L, R, X (L <= R).求A[L] ...
- MD5加密和RSA加密
1.MD5加密 MD5(单向散列算法)的全称是Message-Digest Algorithm 5(信息-摘要算法),MD5算法的使用不需要支付任何版权费用. MD5的功能: ①.输入任意长 ...
- org.xml.sax.SAXParseException; lineNumber: 14; columnNumber: 32; 元素类型为 "key" 的内容必须匹配 "(column)*"
报错:部分错误信息,主要查看CauseBy Caused by: org.hibernate.InvalidMappingException: Unable to read XML at org.hi ...
- Sqli-labs less 5
Less-5 这里说一下,有很多的blog是翻译或者copy的,这关正确的思路是盲注.从源代码中可以看到,运行返回结果正确的时候只返回you are in....,不会返回数据库当中的信息了,所以我们 ...
- 配置无线AP 采用POE供电模块怎么配置无线AP没有POE交换机
韩梦飞沙 韩亚飞 313134555@qq.com yue31313 han_meng_fei_sha 采用POE供电模块怎么配置无线AP没有POE交换机 IP-com f130ap http ...
- SPOJ Time Limit Exceeded(高维前缀和)
[题目链接] http://www.spoj.com/problems/TLE/en/ [题目大意] 给出n个数字c,求非负整数序列a,满足a<2^m 并且有a[i]&a[i+1]=0, ...
- 【2-sat】Gym - 101201F - Illumination
题意:平面上l盏灯,每盏灯可以照亮横向的2*r+1个格子或者纵向的2*r+1个格子,让你确定每盏灯的方向,使得每个格子只被同一行的不超过一盏灯照亮,并且只被同一列的不超过一盏灯照亮.输出是否有解. 显 ...