[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 帐 ...
随机推荐
- Autoit脚本调用pscp上传小程序
linux上传文件用pscp上传相对麻烦,如下写了个脚本方便上传 代码如下: $fileURL=@ScriptDir & "pscp.ini" If (FileExists ...
- 人生苦短_我用Python_OS对目录/文件操作_005
# coding=utf-8 import os # 操作文件和目录 ", os.getcwd()) # 获取当前文件的目录 ", os.path.realpath(__file_ ...
- 获取当前的方法名字,运用线程类Thread
得到当前方法的名字String methodName = Thread.currentThread().getStackTrace()[1].getMethodName(); getStackTrac ...
- Docker安装RMQ
原创转载请注明出处:https://www.cnblogs.com/agilestyle/p/11752934.html 进入rabbitmq的docker hub镜像仓库地址:https://hub ...
- 推荐Html Table和Markown互转的网站Table Convert Online
网站名称:https://tableconvert.com/ 进入网站可以看到可以Table 转为Markdown.JSON.XML.SQL 多种格式 Table(4×5)定义Table的行数和列数: ...
- 空间日志编辑器:word文档图文快速粘贴到web
百度ueditor可以实现word文档图文快速粘贴到web 1.4.2之后官方并没有做功能的改动,1.4.2在word复制这块没有bug,其他版本会出现手动无法转存的情况 本文使用的后台是Java.前 ...
- 转载:IDEA lombok插件的安装和使用
转载自:https://jingyan.baidu.com/article/0a52e3f4e53ca1bf63ed725c.html lombok插件的安装 1 首先我们需要安装IntelliJ ...
- HTML 3-列表、表单、语义化
有序列表.无序列表.自定义列表在语义上的区别 1.有序列表ol>li:列表有顺序编号(默认列表前加1.,2.,3.,...编号),适用于有逻辑顺序的排列项目,而且次序不能乱.2.无序列表ul&g ...
- html标签内部简单加js 一维数组求最大值 最小值两个值位置和数字金字塔图形
html标签内部,简单加js <a href=""></a><!DOCTYPE html PUBLIC "-//W3C//DTD XHTM ...
- Docker容器数据卷volumes-from
定义4个终端: 终端host终端container dc01终端container dc02终端container dc03各个容器之间的关系: 1.启动一个父容器dc01启动一个父容器dc01,并在 ...