pavement

Pw

From FreeBSDwiki
(Difference between revisions)
Jump to: navigation, search
m
Line 1: Line 1:
 
'''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.
 
'''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
+
  ph34r#''' pw useradd newuser -d /home/newuser -g wheel'''
  
 
This creates ''newuser'', sets their home directory to ''/home/newuser'', and their group to [[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
+
  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]].
 
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'''
  
 
This will show all information about the user ''newuser''.
 
This will show all information about the user ''newuser''.
  
  '''ph34r#''' pw usermod newuser -s /sbin/nologin
+
  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.)
 
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
+
  ph34r#''' pw userdel newuser'''
  
 
This deletes the ''newuser'' account entirely.  
 
This deletes the ''newuser'' account entirely.  
  
 
[[Category:System Commands]]
 
[[Category:System Commands]]

Revision as of 15:37, 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. (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.

Personal tools