[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 帐 ...
随机推荐
- 51nod 1661: 黑板上的游戏(sg函数 找规律)
题目链接 先打一个sg函数的表,找找规律,发现sg函数可以递归求解 打表代码如下 #include<bits/stdc++.h> using namespace std; typedef ...
- js 自定义map
<script> function HashMap(){this.map = {};} HashMap.prototype = { put : function(key, value){ ...
- 分布式消息中间件及RabbitMQ
分布式应用和集群: 从部署形态来看,它们都是多台机器或者多个进程部署,而且都是为了实现一个业务功能. 如果是一个业务被拆分成多个子业务部署在不同的服务器上,那就是分布式应用 如果是同一个业务部署在多台 ...
- springmvc的请求参数
@RequestMapping("/testRequestParam") public String testRequestParam(@RequestParam("us ...
- Instagram几个queryhash
page_query_hash 42323d64886122307be10013ad2dcc44comment_query_hash 33ba35852cb50da46f5b5e889df7d159f ...
- C# Self Injector into non managed process
Hey all, I'm gonna explain you how make a self injecting program in C#.I hope you guys thinks its us ...
- DIV置底层或置最高层的方法下拉菜单被挡住
网站常会用到一些 下拉菜单,,幻灯片,,,飘浮广告等. 但经常会发现.幻灯片会挡住下拉菜单或者飘浮广告微信开店等. 解决办法有下 第一,可将幻灯片所在DIV 置于最底层.添加CSS如下 style=& ...
- Reciting(third)
It is subtly demonstrate in the portrayal that a teacher is teaching mathmatics in a certain class ...
- Selenium:多窗口切换(获取窗口句柄handle)
我们在操作网页的时候,点击有些页面的链接,会重新打开一个窗口,我们要在新页面上操作,就得切换窗口 比如在百度首页的登录框点击注册,会重新打开一个注册的新页面,要在新页面注册,就得先切进新页面 那我们怎 ...
- 关于Ext4 extraParams 不能传递动态参数的问题解决办法
可以监听请求发送之前的事件:beforeload ,然后再添加请求的参数 me.store = Ext.create('Ext.data.JsonStore', { remoteSort: true, ...