1

I had originally asked this as a follow-up question here. Unfortunately, there haven't been any replies so I am posting it as its own question.

According to the documentation, you are supposed to be able to use ssh options with sshfs. How do you do this? I have tried something like -o User=joe but then fuse gives me an error saying that "User" is not a recognized option.

Also, help with this question would also be appreciated.


Edit:

I am specifically referring to the following from the manpage for sshfs.

SSHFS options:

  -p PORT
         equivalent to '-o port=PORT'

  -C     equivalent to '-o compression=yes'

  ⋮

  -o password_stdin
         read password from stdin (only for pam_mount!)

  -o SSHOPT=VAL
         ssh options (see man ssh_config)

I am trying to specify the remote username separate from the host (in other words, not user@host:dir). The reason is that particular format is not friendly with some institutionally assigned usernames. For example, if the institution assigns the user name Fist.Last@institution.edu, programs such as sshfs and curlftpfs will not correctly interpret First.Last@institution.edu@host:dir. Instead, they will try to login as First.Last to the host institution.edu@host.

Could you explain a bit more about idmap? I am not literate enough to understand what the manpage is saying.


Edit:

If I use idmap, I am going to have to create hardcoded files. I was hoping to avoid that so that the user can just use a single command without needing to know how it works in the background. Eventually, other people might be using it even after I leave. Even so, the documentation says the file format is username:uid. Which is the local and which is remote?

  • That is how you specify options, I don't think user=joe is a valid option. My guess is you want -o idmap=user . See the man page for valid mount options linux.die.net/man/1/sshfs or update your question as I am not sure what your problem is other than an invalid option or if you need to manually map users – Panther Nov 12 '17 at 21:57
  • @Panther Updated. – Andrew Shum Nov 12 '17 at 22:22
  • Take a look at the arch sshfs page I don't have time to write a long answer right now – Panther Nov 12 '17 at 22:30
  • wiki.archlinux.org/index.php/SSHFS#Secure_user_access – Panther Nov 13 '17 at 1:54
  • idmap only takes none, user, or file explicitly as options, you can't give it a userid. – Organic Marble Nov 13 '17 at 2:09
2

To pass SSH options to SSHFS, you can use ssh_command.

For example, to pass -c aes128-cbc to SSH, use:

sshfs -o ssh_command='ssh -c aes128-cbc' ...
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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