Pw
From FreeBSDwiki
(Difference between revisions)
m |
m (Reverted edits by 66.226.64.215 (Talk); changed back to last version by Jimbo) |
Latest revision as of 11:08, 26 January 2008
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. (With the shell set to /sbin/nologin, any attempt to log in results 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.