Pw
From FreeBSDwiki
(Difference between revisions)
m |
|||
Line 7: | Line 7: | ||
'''ph34r#''' pw usermod newuser -G sambausers -s /bin/csh | '''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 | + | 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 | '''ph34r#''' pw usershow newuser |
Revision as of 01:18, 25 August 2004
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.