Sending a password to sshfs inside a GUI front end

139 views Asked by At

I am trying to make a front end for sshfs in Linux where the user connects with a key + password. I want to be able to send the password to ssh when it asks, then have sshfs stay running when the gui exits.

The Linux terminals are able to do this but I can't figure out what I am doing wrong.

I tried this by creating a tty with the sshfs command and I see the password prompt but when I send it, ssh just quits. If I create a normal ssh connection this works fine. Maybe it is because sshfs spawns ssh?

I tried running with popen () with sshfs -o password_stdin option and sending the password by writing "password\n" to the file pointer returned with popen (). The password does not seem to make it to ssh. Tried with or without the ending '&'.

I tried the system () function with the same -o password_stdin and using with or without the ending '&':

  echo password > sshfs -o password_stdin  ...       (sshfs won't start)
  echo password | sshfs -o password_stdin ...        (times out waiting for prompt)
  sshfs -o password_stdin ... <<< 'password'         (times out waiting for prompt)  

Even when I try: 'echo password | sshfs -o password_stdin ...' in a normal terminal it times out waiting for a password.

Can someone point me in the right direction?

Thanks in advance

0

There are 0 answers