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
rootuser.- ssh root@server_ip_address
Use the
addusercommand 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
usermodcommand to add the user to thesudogroup.- usermod -aG sudo username
By default, on Ubuntu, members of the
sudogroup have sudo privileges.Test sudo access on new user account
Use the
sucommand 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
/rootdirectory, which is normally only accessible to the root user.- sudo ls -la /root
The first time you use
sudoin 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用户默认 ...
随机推荐
- 利用CSS3伪类做3D按钮
这是通过css3伪类实现的3d按钮,html代码为: <div id="container_buttons"> <p><a class="a ...
- 【UI】自动化用例设计技巧
需要封装的方法: 公共的操作方法 经常使用的步骤:超过两次以上 经常使用的组件:输入框.文本框.列表 经常操作的布局:多个组件组成通用的布局 经常操作的页面:ui页面由一个一个单独Activity组成 ...
- Supervisor-类unix系统下的进程控制工具
如果你的英文足够好,请看官网的文档:http://supervisord.org/introduction.html 简介: Supervisor 类unix系统下的进程控制工具. 特性: 1.配置简 ...
- 利用Node 搭配uglify-js压缩js文件,批量下载图片到本地
Node的便民技巧-- 压缩代码 下载图片 压缩代码 相信很多前端的同学都会在上线前压缩JS代码,现在的Gulp Webpack Grunt......都能轻松实现.但问题来了,这些都不会,难道就要面 ...
- python的str,unicode对象的encode和decode方法(转)
python的str,unicode对象的encode和decode方法(转) python的str,unicode对象的encode和decode方法 python中的str对象其实就是" ...
- Python函数式编程——map()、reduce()
文章来源:http://www.pythoner.com/46.html 提起map和reduce想必大家并不陌生,Google公司2003年提出了一个名为MapReduce的编程模型[1],用于处理 ...
- ACM的奇计淫巧_bitset优化
什么是bitset bitset 是STL库中的二进制容器,根据C++ reference 的说法,bitset可以看作bool数组,但优化了空间复杂度和时间复杂度,并且可以像整形一样按位与或. 使用 ...
- JZYZOJ 1388 旅游 状压dp
http://172.20.6.3/Problem_Show.asp?id=1388 求拓扑排序方案数 状压dp,最开始以为是拓扑排序加数论或者搜索,没想到是状压dp,突然气死.jpg: 完全没有 ...
- ARC-100 E - Or Plus Max
题面在这里! 我们如果可以求出 f[x] = max{ a[i] + a[j] , i!=j && i or j == x},那么就可以通过前缀max直接递推答案了. 但是这个玩意不是 ...
- SD 一轮集训 day4 弦形袋鼠
可以发现把每一个 a[i] * b[i] 加到矩阵里去,就相当于 把一个 1*m 的向量伸缩后变成 n个再加到矩阵里去,所以答案就是远=原矩阵中线性线性无关组的个数. (而且好像一个矩阵横着消元和竖着 ...