Temporarily Disable User Account

I want to temporarily disable a user account on HP-UX at the start of a script and renable the account at the end of the script. What would be the best method on HP-UX to temporarily disable a user account? I know of the passwd -l option that will lock the account, but I do not see a flag for unlocking the account. I was hoping to avoid messing with the /etc/passwd file if possible.

Has anyone performed something similar and how did you go about doing it? Thanks in advance.

one suggestion may be :
To disable an account put an * in front of the account line in /etc/passwd.
To enable it again remove the * in front of the line.

Depending on your version of HP-UX, change the "crypted password" field in the /etc/passwd or /etc/shadow file in a string which never can be generated.

Commonly a "*" or something like "NP" is used.

Whatever the password is, it can never result in a crypted string which is equal to "*" or "NP".

Too unlock the account, simply set a new password for the locked account using, as "root", the command "passwd <user>"

You can always just
passwd -l <username> to lock it.
/usr/lbin/modprpw -l -k <username> will unlock it.
a CE taught me the last one... I think its a command used internally via sam.

You can use the below ones.

usermod -e 'yesterday' <username> (expire the user a/c)

usermod -s '/bin/false' <username> (set the shell to /bin/false)

Changing the shell to /bin/false will disable the user's ability to login.