![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Root account - disable expiry | frustrated1 | SUN Solaris | 6 | 05-26-2008 09:02 AM |
| how to block a user temporarily? | winky | AIX | 3 | 06-19-2007 10:27 AM |
| Temporarily disable effect of set -e in ksh | ugeek | Shell Programming and Scripting | 1 | 03-28-2007 04:21 AM |
| delete or disable the system generated account | sak900354 | UNIX for Dummies Questions & Answers | 1 | 06-15-2006 07:40 AM |
| How to disable cd to other folder for a user | Dilippatel | AIX | 1 | 12-02-2003 07:45 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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. |
|
||||
|
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. Last edited by Eronysis; 01-26-2007 at 04:13 AM.. |
|
||||
|
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. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|