Passwordless sshfs mount over reverse-ssh

0

I'm trying to mount a host directory onto a remote machine using reverse-ssh and sshfs

For the most part, running the following command on the host works

ssh -t -L 0.0.0.0:10000:localhost:10000 -i /home/<local-user>/.docker/machine/machines/aws-sandbox/id_rsa -p 22 <remote-user>@<remote-ip> -R 10000:localhost:22 source /etc/profile;mkdir /home/<remote-user>/test;sudo sshfs -o NoHostAuthenticationForLocalhost=yes -odebug -o allow_other -p 10000 <local-user>@localhost:/home/<local-user>/local/path/to/mount /home/<remote-user>/test

but no matter what I do I can't seem to get this work without it putting up a password prompt for

<local-user>@localhost's password:

If I enter the password at the prompt, the mount is correctly initialized and works as expected. How can I do this in a password-less fashion?

Ani

Posted 2020-01-03T04:10:48.567

Reputation: 113

Answers

0

I could not get this method to work, but I did using the information from this excellent article!

Here's my final command that even uses docker-machine ssh to eliminate some of the nastiness of passing in ssh auth arguments.

dpipe /usr/lib/openssh/sftp-server = docker-machine ssh <machine-name> sshfs :/host/path/to/mount /remote/path/to/mount/at -o slave

Note: The dpipe command needs the vde2 package installed on the host to work.

Ani

Posted 2020-01-03T04:10:48.567

Reputation: 113