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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logout at end of script / passwd resetter

Status
Not open for further replies.

allywilson

Technical User
Nov 27, 2002
157
0
0
GB
Hi all,
I'm making a script so that a helpdesk can login to a solaris 9 box, be presented with a prompt to enter someones username and it then runs "passwd -d -f $username" so that it essentially resets the password to nothing and requires the user to change at next logon.

I can do the above no problem. But I don't want them to login as the root user - is there a way I can give permissions to another user account so that it can reset the password of other users?

Also, at the end of the script I want it to log the user out, but I don't have the logout command available.

Any ideas?

Thanks,

Ally
 
Have you considered sudo?

Some days are diamonds, some days are rocks - make sure most are the former.
 
Yes, sudo was considered - but it's not available (and I can't modify this server by adding or removing anything).

We eventually got around the issue by creating a new account with:
Code:
useradd -o -u 0 USERNAME

And forcing the shell it uses to be the script (so that upon exiting the script, it exits the session).

Setup the authorized_keys file, published a putty session on our citrix farm - et voila. Servicedesk login to Citrix, click on the published putty session, authenticates with the private key, script pops up requesting a username, they enter a username, passwd command runs and it exits immediately.
 
how about rbac, create a role that only can do what you need.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top