FreeBSD locking an account

www.l‮iruttua‬.com
FreeBSD locking an account

To lock an account on a FreeBSD system, you can use the pw utility to modify the account's password file entry.

To lock an account, you will need to set the account's password to a value that cannot be used to log in. This can be done by setting the password to an asterisk (*) or a locked password string, such as *LK*.

For example, to lock the account john, you can run the following command:

# pw usermod john -w *

This will set the password for the john account to an asterisk, which will prevent the account from being used to log in.

To unlock the account, you can use the pw utility to set a new password for the account:

# pw usermod john -h 0

This will set a new password for the john account and remove the password lock.

Note that you will need to have the necessary permissions to modify the password file on the system.

For more information about locking and unlocking accounts on a FreeBSD system, you can refer to the FreeBSD documentation and the pw man page by running man pw on the command line.

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