快速业务通道

linux用户管理实验3:usermod命令

作者 佚名技术 来源 Linux系统 浏览 发布时间 2012-03-24

linux用户管理实验3:usermod命令

[root@long ~]# usermod -c ''wwwwwwwww'' test11 修改账户的注释信息

[root@long ~]# grep test11 /etc/passwd test11:x:600:600:wwwwwwwww:/home/test11:/bin/bash 注意第五个字段的内容 [root@long ~]# usermod -d /test11 test11 修改账户的宿主目录 [root@long ~]# grep test11 /etc/passwd test11:x:600:600:wwwwwwwww:/test11:/bin/bash 注意第六个字段的内容 [root@long ~]# usermod -e 2009/01/30 test11 修改账户的有效日期 [root@long ~]# grep test11 /etc/shadow test11:!!:14252:0:99999:7::14274: 注意第8个字段的内容 [root@long ~]# usermod -f 10 test11 账户过期10天后永久停权,当值为0时则立刻被停权,当值为-1时则关闭此功能.默认值为-1 [root@long ~]# grep test11 /etc/shadow test11:!!:14252:0:99999:7:10:14274: [root@long ~]# usermod -g root test3 修改账户test3的群组为root [root@long ~]# grep test3 /etc/passwd test3:x:503:0::/home/test3:/bin/bash 注意第四个字段的内容变为0了,即root [root@long ~]# id test3 查看账户test3id信息 uid=503(test3) gid=0(root) groups=0(root) [root@long ~]# usermod -G sys,adm test3 修改账户test3的次要群组为sysadm [root@long ~]# id test3 再次查看账户test3id信息,注意结果跟上次结果的变化 uid=503(test3) gid=0(root) groups=0(root),3(sys),4(adm) [root@long ~]# usermod -l test33 test3 test3账户的名字修改为test33 [root@long ~]# grep test3 /etc/passwd test33:x:503:0::/home/test3:/bin/bash 注意第一个字段的内容 [root@long ~]# usermod -s /sbin/nologin test33 修改test33账户的shell/sbin/nologin [root@long ~]# grep test33 /etc/passwd test33:x:503:0::/home/test3:/sbin/nologin 注意第七个字段的内容 [root@long ~]# usermod -u 555 test33 修改test33账户的uid555 [root@long ~]# grep test33 /etc/passwd 注意第三个字段的内容 test33:x:555:0::/home/test3:/sbin/nologin [root@long ~]# usermod -L test33 锁定账户test33的口令 [root@long ~]# passwd -S test33 查看test33口令的状态 test33 LK 2009-01-07 0 99999 7 -1 (Password locked.) 结果为锁定状态 [root@long ~]# usermod -U test33 解锁test33账户的口令 [root@long ~]# passwd -S test33 再次查看test33口令的状态 test33 PS 2009-01-07 0 99999 7 -1 (Password set, MD5 crypt.)

本文出自 “龙目小子,博闻天下” 博客,请务必保留此出处http://longmuxiaozi.blog.51cto.com/865148/734108

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号