The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > HP-UX
.
google unix.com



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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-22-2007
scotbuff scotbuff is offline
Registered User
  
 

Join Date: Jun 2005
Location: Middletown, PA
Posts: 73
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.
  #2 (permalink)  
Old 01-22-2007
XinU*'s Avatar
XinU* XinU* is offline
Registered User
  
 

Join Date: Jan 2005
Posts: 15
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.
  #3 (permalink)  
Old 01-24-2007
sb008 sb008 is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 384
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>"
  #4 (permalink)  
Old 01-25-2007
Eronysis Eronysis is offline
Registered User
  
 

Join Date: Nov 2005
Location: Arizona
Posts: 83
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..
  #5 (permalink)  
Old 01-26-2007
Krrishv Krrishv is offline
Registered User
  
 

Join Date: Dec 2006
Location: CA,United States
Posts: 186
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.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:58 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0