Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to disable login except for root

Status
Not open for further replies.

new2me

Technical User
Mar 12, 2004
176
CA
we have a need to disable login except for root and another ID. Does anyone know an easy way or is it even possible? Don't want to expire the password either.

To those reply to this message, thank-you in advance.

PS: HPUX 11i
 
Although it's not elegant, you can insert a test in the /etc/profile script to look for the username and exit if it isn't "root" (or a few select others).
If the exit doesn't log the user out, you may have to take it a step further and kill the current process by PID number.
I've performed similar tasks if a Client just wants to limit the system during a period of time.
Be careful if you play with /etc/profile, as a mistake could render the system inaccessible.
 
f.y.i.

quick & dirty we end up doing... copy the /etc/passwd file then removed the IDs except for root etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top