[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 帐 ...
随机推荐
- 关系型数据库---MYSQL---优化
1.为什么要进行SQL优化? 1.1 查询性能低 1.2 执行时间过长 1.3 等待时间过长 1.4 SQL写的太差(尤其是多表关联查询) 1.5 索引失效 1.6 服务器参数(缓存.线程数)设置不合 ...
- python3用pygame实现播放音乐文件
import pygameimport time #导入音乐文件file = r'C:\1.wav'pygame.mixer.init()track = pygame.mixer.music.load ...
- nuget cli 打包发包
微软官网打包说明:https://docs.microsoft.com/zh-cn/nuget/quickstart/create-and-publish-a-package-using-visual ...
- [转]Windows 10 无法访问共享的解决办法大全
本文前面介绍 Windows 10 操作系统无法访问其他电脑的共享文件夹,而其他电脑访问该共享可以访问的解决办法. 简单点说就是,你的操作系统是 Win10 ,你访问不了某台电脑的共享,但是别人可以. ...
- onclick 调用js选择器
- php trim()函数 语法
php trim()函数 语法 trim()函数怎么用? php trim()函数用来删除字符串两端的空格或其他预定义字符,语法是trim(string,charlist),返回经过charlist处 ...
- Java和Tomcat的关系 Java如何发布web服务
https://blog.csdn.net/qq_31301961/article/details/80732669 除了Tomcat还有WebLogic 大型分布式的 如何部署映射 Tomcat使用 ...
- window使用
运行命令 regedit #注册表编译器 firewall.cpl #打开防火墙配置 powershell #打开powershell control #打开控制面版 cnpa.cpl #打开网络设置 ...
- 禁止多用户进入win7系统的方法(图文)
windows7系统可以支持多用户登陆,虽然它能为使用者提供方便,但是为安全起见,一些用户想要禁止多用户进入win7系统,因为我们并不能保证其他账户用户在使用过程中是否会安装病毒程序.那么如何禁止多用 ...
- NGINX配置之二: nginx location proxy_pass 后面的url 加与不加/的区别.
这里我们分4种情况讨论 这里我们请求的网站为:192.168.1.123:80/static/a.html 整个配置文件是 server{ port 80, server name 192.168.1 ...