I use a small programm = sshpass to use ssh in a script to execute commands on linux routers

Is there a alternative to sshpass because sshpass works at the moment not correctly (Bugs) - incompatibilities with the sshclient

link|improve this question
feedback

2 Answers

Here is its alternative available:

http://stackoverflow.com/questions/714915/using-the-passwd-command-from-within-a-shell-script

but this is NEVER recommended as it is a serious security weakness and can lead your system open to anyone. better to setup password-less ssh login to the machines on which you want to run specific commands.

link|improve this answer
it not work because the --stdin works only with passwd not with ssh it gives an error. i know the security weakness but the client and the router are in a vpn network and nobody from outsite can access to this clients. – bulleric Nov 11 '11 at 12:41
what about keyless ssh authentication? isnt that possible? – Frank Nov 11 '11 at 12:42
sadly not because the root system is read only and a cant send a key file to this system. I will write a small script was execute a script to update the router configuration over ssh – bulleric Nov 11 '11 at 12:46
then --stdin would work for you as mentioned in the link i gave. – Frank Nov 11 '11 at 12:48
ssh got no option --stdin when i test it i got an error : Pseudo-terminal will not be allocated because stdin is not a terminal. – bulleric Nov 11 '11 at 14:47
feedback

It didn't look like anyone mentioned expect yet: http://linux.die.net/man/1/expect

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.