Jump to content
  • Announcements

    • spinynorman

      Mandriva Official Documentation

      Official documentation for extant versions of Mandriva can be found at doc.mandriva.com.   Documentation for the latest release may take some time to appear there. You can install all the manuals from the main repository if you have Mandriva installed - files are prefixed mandriva-doc.
    • paul

      Forum software upgrade   10/29/17

      So you may have noticed the forum software has upgraded !!!
      A few things that have changed. We no longer have community blogs (was never really used) We no longer have a portal page.
      We can discuss this, and decide whether it is needed (It costs money) See this thread: Here
Sign in to follow this  

How to write a password-entering ssh script?

Recommended Posts

I use an ssh tunnel which needs a password, where the characters entered are not displayed. I tried different methods:



sh -c "password" | ssh -L 6700: user@sshtunnel.net



ssh -L 6700: user@sshtunnel.net

sh -c "password"


I tried 'echo "password" | ssh -L 6700: user@sshtunnel.net' but this only works where password characters are displayed.


The technical support guy said that the ssh server won't allow public-key placement because of vulnerabilities of openssl.


Incidentally, it always says "#!/bin/bash: no such file". I checked: it is there.


I also tried to change the algorithms:

ssh -c aes128-ctr, aes192-ctr, aes256-ctr, aes128-cbc, cast128-cbc, arcfour128, arcfour256, arcfour, aes192-cbc, aes256-cbc, 3des-cbc

but it always says there's a problem resolving the second algorithm.

Share this post

Link to post
Share on other sites

man expect


wrap your ssh connection in expect ... expect can enter a password for you

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this