Linux usermod命令

Linux 教程 · 2019-02-16 20:56:39

Linux usermod命令用于修改用户帐号。

usermod可用来修改用户帐号的各项设定。

语法

usermod [-LU][-c <备注>][-d <登入目录>][-e <有效期限>][-f <缓冲天数>][-g <群组>][-G <群组>][-l <帐号名称>][-s <shell>][-u <uid>][用户帐号]

参数说明

  • -c<备注>  修改用户帐号的备注文字。
  • -d登入目录>  修改用户登入时的目录。
  • -e<有效期限>  修改帐号的有效期限。
  • -f<缓冲天数>  修改在密码过期后多少天即关闭该帐号。
  • -g<群组>  修改用户所属的群组。
  • -G<群组>  修改用户所属的附加群组。
  • -l<帐号名称>  修改用户帐号名称。
  • -L  锁定用户密码,使密码无效。
  • -s<shell>  修改用户登入后所使用的shell。
  • -u<uid>  修改用户ID。
  • -U  解除密码锁定。

实例

更改登录目录

# usermod -d /home/hnlinux root

改变用户的uid

# usermod -u 777 root

点击查看所有 Linux 教程 文章: https://www.codercto.com/courses/l/14.html

查看所有标签

Introduction to Computer Science Using Python

Introduction to Computer Science Using Python

Dierbach, Charles / 2012-12 / $ 133.62

Introduction to Computer Science Using Python: A Computational Problem-Solving Focus introduces students to programming and computational problem-solving via a back-to-basics, step-by-step, objects-la......一起来看看 《Introduction to Computer Science Using Python》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具