su,exit,adduser,deluser,usermod,groups
exit
退出当前用户
su
切换到指定用户,缺省表示切换到root用户
adduser
创建一个用户的时候其实是创建了一个用户和同名的用户组,它们都会UID,所属的GID,创建时一个用户属于和自己同名的用户组,可以更改一个用户所属的用户组,但是之前创建的同名用户组还会存在
sudo adduser new_user_name
$sudo adduser test_user
[sudo] password for jiang:
Adding user `test_user' ...
Adding new group `test_user' (1001) ...
Adding new user `test_user' (1001) with group `test_user' ...
Creating home directory `/home/test_user' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for test_user
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] y
deluser
删除一个用户
sudo deluser --remove-home yu
groups
查看当前用户的组内成员
/etc/group文件包含了所有的用户组
/etc/shadow和/etc/passwd包含了所有的用户名和密码信息
usermod
更改用户所属的组
$sudo usermod -g GID_or_GroupName UID_or_UserName
$sudo usermod -G username groupA #user离开原来的组,加入到groupA中
$sudo usermod -a -G user groupA #-a 表示-append,user不离开原来的组,加入到groupA中
su,exit,adduser,deluser,usermod,groups的更多相关文章
- Linux入门 (笔记)
Man can conquer nature. "人定胜天" 一.基本操作 1.重要快捷键 Tab 补全命令.目录.参数.文件名等 Ctrl+c 强制终止当前的程序 Ctrl+ ...
- linux用户创建删除以及文件权限查看修改
一. 1.查看用户 命令如下:whoami 2.创建用户 创建用户命令:sudo adduser hello 超级用户是 root 删除用户名命令:sudo deluser hello --remov ...
- Linux useful commands
cat misc. cat xxx | more cat xxx | less cat > xxx , create a file xxx cat -n xxx | more with line ...
- linux:用户及文件权限管理
学习内容来自实验楼.莫烦python.CSDN 一.Linux 用户管理 1. 查看用户 who am i 或者who mom likes who -a:打印所有能打印的 who -d :打印死掉的 ...
- linux的简单操作
查看当前用户who am i 创建用户:sudo adduser lilei然后输入密码 查看用户:ls /home 用新用户登陆:su -l lilei 查看所属用户组:groups 用户名 新建文 ...
- Ubuntu 14.04(amd64)安装Oracle11g XE(x64)
下载Oracle安装包 下载地址:Oracle Database Express Edition 11g Release 2 for Linux x64 安装办法 1、建立oracle用户及属主 ad ...
- Linux添加用户user到用户组group
添加用户:useradd niot 添加到组:usermod -a -G root niot 改密码:passwd niot 切换:su - niot 查看用户组:groups 将一个用户添加到用户组 ...
- 20165220预备作业3 Linux安装及学习
首先对于这第三次作业而言,给我的准备时间确实不多,因为过年回老家6天,没有办法及时的进行学习和思考,回到家中便草草的看了下相关操作跟教程从而完成了作业,这次主要是学习一些基础操作,为开学的Java学习 ...
- OracleOCP认证 之 Linux基础
Linux 基础 一.SHELL 1: Shell 简介 shell 是用户和Linux 操作系统之间的接口.Linux 中有多种shell, 其中缺省使用的是bash. Linux 系统的shell ...
随机推荐
- 第 17 章 CSS 边框与背景[上]
学习要点: 1.声明边框 2.边框样式 3.圆角边框 主讲教师:李炎恢 本章主要探讨 HTML5 中 CSS 边框和背景,通过边框和背景的样式设置,给元素增加更丰富的外观. 一.声明边框 边框的声明有 ...
- 第 15 章 CSS 文本样式[上]
学习要点: 1.字体总汇 2.字体设置 3.Web 字体 主讲教师:李炎恢 本章主要探讨 HTML5 中 CSS 文本样式,通过文本样式的设置,更改字体的大小.样式以及文本的方位. 一.字体总汇 本节 ...
- sso demo 取消https (cas)
基本配置 参考之前得随笔 http://www.cnblogs.com/rocky-fang/p/5354947.html 1. 修改tomcat-cas 配置 1.1 在 D:\test\sso\ ...
- iOS 获取网络图片的大小
一直都在找关于获取网络图片的大小的方法, 今天找到了一个能解决的办法 ,如下 1, 导入框架 #import <ImageIO/ImageIO.h> 2. 使用此方法得到image的siz ...
- Windows 安装启动apache时出现错误的解决方法
配置安装Apache主服务发生错误:(OS 5)拒绝访问. : AH00369: Failed to open the Windows service manager, perhaps you fo ...
- What is the difference between a binary tree, a binary search tree, a B tree and a B+ tree?
Binary Tree : It is a tree data structure in which each node has at most two children. As such there ...
- javascript模式 (3)——工厂模式和装饰模式
上节我们讲解了单例模式,这节我们将继续讲解工厂模式和迭代器模式 工厂模式: 工厂模式的目的是为了方便的创建对象(可以在不知道构造的情况下),通过静态方法来实现,在java或c#等静态编译语言中需要通过 ...
- jQuery jquery.windy 快速浏览内容
在线实例 效果一 效果二 效果三 使用方法 <div class="container"> <section class="main" ...
- 15款最佳的MySQL管理工具和应用程序
工欲善其事,必先利其器.几乎每个开发人员都有最钟爱的 MySQL 管理工具,它帮助开发人员在许多方面支持包括 PostgreSQL,MySQL,SQLite,Redis,MongoDB 等在内的多种数 ...
- EpicEditor – 可嵌入的 JavaScript Markdown 编辑器
EpicEditor 是一款可以嵌入到网页中的 JavaScript Markdown 编辑器,支持全屏编辑.在线预览.自动保存草稿,离线支持等等.对于开发人员,它提供了一个健壮的API,可以很容易定 ...