in reply to scp and ssh without passwd

I personally see no problem with using Expect for this. I've written a number of Expect scripts to semi-automate doing repetitive things on multiple servers. When you have 200+ servers to deal with and no NIS or LDAP, and strict password expirations on all servers (even for admins, thanks to our auditors...), you tend to find great utility in Expect.

I'm not sure this is what you're asking, but when prompting for password I just use system stty -echo in the expect script, and use send_user to give me any output I need to see.

For the actual ssh session: spawn -noecho ssh $hostname should work nicely.

Replies are listed 'Best First'.
Re: Re: scp and ssh without passwd
by perlknight (Pilgrim) on Feb 27, 2002 at 20:55 UTC
    Koodoes to you tempehjunkie!!!. Yes this is what I was looking for; $object->slave_pty->stty('-echo'); and $object->slave_pty-stty('echo'); Yes, on some occasion your really need expect to do the job. In particalar the realms of Administrations, If you have to reset root's password on over 100 servers, then I don't expect you to sit down and log into every one and reset them. I think not :-), this is where Expects comes in. I used it in conjuction with ssh. I also use Expect to do the initiall Private and Public keys stuff so that I may login later without providing password. Thanks to all for participating in this thread.