Operating System - HP-UX
1751847 Members
5064 Online
108782 Solutions
New Discussion юеВ

Re: How to launch the passwd command through remsh

 
Augusto Vinhaes
Frequent Advisor

How to launch the passwd command through remsh

I'm testing some scripts and I'd like to launch the passwd command through remsh. The problem is that the passwd command requires keyboard input and this is not possible via remsh. I always got the message "Cannot open your control terminal". Is there a way to do it ? Maybe using input redirection ...

Thanks,
Augusto
Augusto
5 REPLIES 5
John Palmer
Honored Contributor

Re: How to launch the passwd command through remsh

One way is to use an 'expect' script. You can download expect from:
http://hpux.cs.utah.edu/hppd/hpux/Tcl/expect-5.33/

Regards,
John
Craig Rants
Honored Contributor

Re: How to launch the passwd command through remsh

Did you use the -n option? If you want to use it without prompting, look at using the expect language.

GL,
C
"In theory, there is no difference between theory and practice. But, in practice, there is. " Jan L.A. van de Snepscheut
Anu Mathew
Valued Contributor

Re: How to launch the passwd command through remsh

Hi there,

We have about 53 servers here and for changing passwords of a particular user on all the server, we do the following:

1) Change the password of the user on a particular box (in our case, the admin server).

Once this is done, we replace the corresponding line or password field of all the /etc/passwd files on all the servers for the said user.

Notes: This inter-operatability is limited to HP-UX servers only. We have 10.20 and 11.00 here and it works here.

In case you wanted a Linux box's password to be reset, this will not work there since the PAM (password authentication module) libraries are different there.

Hope this helps,

Thanks

Anu Mathew
harry d brown jr
Honored Contributor

Re: How to launch the passwd command through remsh

Look into this as a start:

http://www.forward.com.au/freebees/webpasswd.htm


live free or die
harry
Live Free or Die
Rodney Hills
Honored Contributor

Re: How to launch the passwd command through remsh

If you have a non-trusted non-PAM non-NIS system, you could edit the /etc/password directly and replace the password.

Here is a small C program to generate an encrypted password suitable for /etc/passwd.
(find attached a "C" subroutine that does the actual encryption)

#include

main (argc, argv)
int argc;
char *argv [];
{
char *tt[200];
make_passwd (argv[1], tt);
puts(tt);
}


-- Rod Hills
There be dragons...