FreeBSD pw command examples

www.lautt‮moc.iru‬
FreeBSD pw command examples

The pw command is a utility for managing user accounts on a FreeBSD system. Here are a few examples of how you can use the pw command:

  1. Add a user: To add a new user to the system, you can use the pw useradd command. For example:
pw useradd -n username -m -G wheel

This will create a new user with the name username, create a home directory for the user, and add the user to the wheel group.

  1. Set a password for a user: To set a password for a user, you can use the pw usermod command with the -h option. For example:
pw usermod username -h 0

This will set the password for the user username to a value of 0. You should replace 0 with the desired password.

  1. Change the shell for a user: To change the default shell for a user, you can use the pw usermod command with the -s option. For example:
pw usermod username -s /bin/csh

This will set the default shell for the user username to csh.

  1. Delete a user: To delete a user from the system, you can use the pw userdel command. For example:
pw userdel username

This will delete the user username and remove the user's home directory.

Created Time:2017-10-28 20:40:37  Author:lautturi