useradd sunday
常用選項:
-u 720 — 指定 UID-g 100 — 指定初始群組-M — 不建立家目錄-d /path/to/dir — 指定家目錄路徑-s /bin/bash — 指定預設登入 shell完整範例:useradd -u 720 -g 100 -M -s /bin/bash sunday
passwd sunday
usermod -L sunday — 鎖定,阻止登入usermod -U sunday — 解鎖,恢復登入權限usermod -e 2008-08-08 sunday
groupadd debian — 新增群組useradd -g debian sunday — 新增使用者指定群組usermod -g debian sunday — 修改使用者初始群組groupdel debian — 刪除群組儲存使用者基本資訊,格式:
username:password:UID:GID:comment:home directory:shell
x,加密密碼存於 /etc/shadow)儲存加密密碼與密碼策略,格式:
username:encrypted_password:last_changed:min:max:warn:inactive:expire:reserved
* 表示無法登入範例:drobbins:$1$1234567890123456789012345678901:11664:0:-1:-1:-1:-1:0
儲存群組資訊,格式:
groupname:x:GID:usernames
/etc/shadow範例:root:x:0:root,sunday,onlyisi