Operating System - HP-UX
1847100 Members
5275 Online
110263 Solutions
New Discussion

Re: problem with passwd using expect

 
Mark Greene_1
Honored Contributor

problem with passwd using expect

I am working on a process to allow our help desk personnel to be able to reset people's passwords. I want to be able to set the password to something generic, and to also set the password to expire when they login next, so they can keep using the same generic password.

Attached is the section of code from the shell script. What is happening is that the password is either changed, or expired, but only occasionally both. Which ever of the changes is run last is what is taking effect. It appears to be similar to the "last write wins" scenario with databases when failing to appropriately lock a table, except this is a single shell script and I've never run into that situation within a single script before.

Has anyone else seen this, or can anyone spot the problem in the script that's causing this? And to complicate matters, TCB is NOT active on the system, and as of yet I don't have authorization to activate it.

TIA
mark
the future will be a lot like now, only later
2 REPLIES 2
Mark Grant
Honored Contributor

Re: problem with passwd using expect

This isn't too helpful but there is a lot to be said for directly editing a copy of the passwd file, putting in a known encrypted string for the password with a ",M0" at the end. It doesn't solve your problem but it is often the simplest way of doing what you want.
Never preceed any demonstration with anything more predictive than "watch this"
Mark Greene_1
Honored Contributor

Re: problem with passwd using expect

Not realy an option. I'd have to script that, and even if I used expect to feed the commands to vipw, I'd never be 100% confident that it wasn't going to corrupt the password file. I'm trying to avoid giving another group of people the root password.
the future will be a lot like now, only later