[REPRINT]MODIFYING USER ACCOUNTS(usermod)
Append Additional Groups to an exiting account
usermod -a -G group1,group2,group3 userid
[root@fedsrv01a ~]# id testuser
uid=1001(testuser) gid=1004(testuser) groups=1004(testuser)
[root@fedsrv01a ~]# groups testuser
testuser : testuser
[root@fedsrv01a ~]# usermod -a -G group1,group2,group3 testuser
[root@fedsrv01a ~]# id testuser
uid=1001(testuser) gid=1004(testuser) groups=1004(testuser),1001(group1),1002(group2),1003(group3)
[root@fedsrv01a ~]# groups testuser
testuser : testuser group1 group2 group3
Change a Users Home Directory
usermod -d /new/home userid
root@john-desktop:/home# grep testuser /etc/passwd
testuser:x:1003:1235:testuser:/home/testuser:/bin/sh
root@john-desktop:/home# usermod -d /home/new testuser
root@john-desktop:/home# grep testuser /etc/passwd
testuser:x:1003:1235:testuser:/home/new:/bin/sh
Change a Users Default Shell
usermod -s /bin/bash userid
The "-s" option is used to specify a shell to be used with the specified user. By default most Linux systems will assign the "Bash Shell". However, many systems often have other shells available or shells that can be installed. To display what shells are available on your system, simply issue the command: "cat /etc/shells". In the example below we are going to change the users shell from the default "Bash Shell" to the "Korn Shell".
[root@fedsrv01a ~]# grep testuser /etc/passwd
testuser:x:1001:1004:Test User Account:/home/testuser:/bin/bash
[root@fedsrv01a ~]# usermod -s /bin/ksh testuser
[root@fedsrv01a ~]# grep testuser /etc/passwd
testuser:x:1001:1004:Test User Account:/home/testuser:/bin/ksh
Change User Comment Description - ( gecos )
usermod -c "Change my comment info" testuser
[root@fedsrv01a ~]# grep testuser /etc/passwd
testuser:x:1001:1004:Test User Account:/home/testuser:/bin/ksh
[root@fedsrv01a ~]# usermod -c "Testing Account Only" testuser
[root@fedsrv01a ~]# grep testuser /etc/passwd
testuser:x:1001:1004:Testing Account Only:/home/testuser:/bin/ksh
Change a users UID
usermod -u UID testuser
This option allows you to change the "UID", a numerical value that identifies a user's account.
[root@fedsrv01a ~]# grep testuser /etc/passwd
testuser:x:1001:1004:Testing Account Only:/home/testuser:/bin/ksh
[root@fedsrv01a ~]# usermod -u 1010 testuser
[root@fedsrv01a ~]# grep testuser /etc/passwd
testuser:x:1010:1004:Testing Account Only:/home/testuser:/bin/ksh
[REPRINT]MODIFYING USER ACCOUNTS(usermod)的更多相关文章
- A Complete Guide to Usage of ‘usermod’ command– 15 Practical Examples with Screenshots
https://www.tecmint.com/usermod-command-examples/ -------------------------------------------------- ...
- (译)"usermod"命令使用完全指导---15个练习例程截图
"usermod"命令使用完全指导---15个练习例程截图 By Babin Lonston Under: Linux Commands On: November 11, 2014 ...
- 【Linux命令】用户身份(useradd,groupadd,usermod,passwd,userdel)
目录 用户身份 useradd userdel usermod groupadd groupdel passwd chage 用户身份 在linux系统中和windows一样有用户之分.root用户为 ...
- mysqldump: Got error: 1142: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'accounts' when using LOCK TABLES
AutoMySQLBackup备份时,出现mysqldump: Got error: 1142: SELECT, LOCK TABLES command denied to user 'root'@' ...
- Linux – Usermod命令参数解析和实例说明
usermod 命令修改系统帐户文件来反映通过命令行指定的变化 1. 首先看看usermod都是有哪些参数 [root@hxweb101 ~]$ usermod --help Usage: userm ...
- Linux 新建用户、用户组,给用户分配权限(chown、useradd、groupadd、userdel、usermod、passwd、groupdel)
Linux 系统是一个多用户多任务的分时操作系统,任何一个要使用系统资源的用户,都必须首先向系统管理员申请一个账号,然后以这个账号的身份进入系统.用户的账号一方面可以帮助系统管理员对使用系统的用户进行 ...
- This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes.
-- :::] This application is modifying the autolayout engine from a background thread, which can lead ...
- Net accounts命令
Net accounts 将用户帐户数据库升级并修改所有帐户的密码和登录请求. 语法 net accounts [/forcelogoff:{minutes | no}] [/minpwlen:len ...
- linux-15基础命令之-用户与用户组(useradd,userdel,usermod,passwd,groupadd)
1.useradd 命令用于创建新的用户,格式为:useradd[选项] 用户名 useradd参数 参数 作用 -d 指定用户的家目录(默认/home/username) -D 展示默认值 -e 帐 ...
随机推荐
- vmware版本选择
vmware哪个版本好用 2014-03-10 22:59一枚小白3 | 分类:常见软件 | 浏览6743次 准备装ghost xp,想问下哪个版本更适合?或者现在哪个版本更稳定,求不要复制,求大神解 ...
- pipelines和重定向命令
pipelines: command1 | command2 例如,ls -l /usr/bin | less,将输出结果作为 less 命令的输入结果,在standard output 中显示出来. ...
- Angular JS - 7 - Angular JS 常用指令2
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...
- linux网络接口,struct ifreq struct ifconf结构
网络相关的ioctl请求的request参数及arg地址必须指向的数据类型如下表所示: 接口 SIOCGIFCONF SIOCSIFADDR SIOCGIFADDR SIOCSIFBRDADDR SI ...
- Word图片粘贴上传控件,直接粘贴图片到编辑器-DEDE
很多时候我们用一些管理系统的时候,发布新闻.公告等文字类信息时,希望能很快的将word里面的内容直接粘贴到富文本编辑器里面,然后发布出来.减少排版复杂的工作量. 下面是借用百度doc 来快速实现这个w ...
- HDU 5667 构造矩阵快速幂
HDU 5667 构造矩阵快速幂 题目描述 解析 我们根据递推公式 设 则可得到Q的指数关系式 求Q构造矩阵 同时有公式 其中φ为欧拉函数,且当p为质数时有 代码 #include <cstdi ...
- Transform.Find()
代码演示: using System.Collections;using System.Collections.Generic;using UnityEngine; public class Tran ...
- 2018-2019 2 20165203 《网络对抗技术》Exp9 Web安全基础
2018-2019 2 20165203 <网络对抗技术>Exp9 Web安全基础 实验要求 本实践的目标理解常用网络攻击技术的基本原理,做不少于7个题目,共3.5分.包括(SQL,XSS ...
- upc组队赛16 Melody【签到水】
Melody 题目描述 YellowStar is versatile. One day he writes a melody A = [A1, ..., AN ], and he has a sta ...
- docker 提示 Drive has not been shared 错误
Creating laradock_docker-in-docker_1 ... Creating laradock_docker-in-docker_1 ... error ERROR: for l ...