pavement

Pw

From FreeBSDwiki
Revision as of 02:17, 25 August 2004 by Jimbo (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

pw is the system command used to modify and rebuild /etc/passwd, /etc/master.passwd, and the system user account database generated from those files.

ph34r# pw useradd newuser -d /home/newuser -g wheel

This creates newuser, sets their home directory to /home/newuser, and their group to wheel.

ph34r# pw usermod newuser -G sambausers -s /bin/csh

This modifies newuser by adding sambausers as a secondary group on the account, and setting the default shell to the C Shell.

ph34r# pw usershow newuser

This will show all information about the user newuser.

ph34r# pw usermod newuser -s /sbin/nologin

This effectively disables the newuser account for interactive login purposes, because any attempt to log in will result in a "This account has been disabled" message followed by immediate closure of the session.

ph34r# pw userdel newuser

This deletes the newuser account entirely.

Personal tools