Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to configure the automounter (either Linux or OSX) with FUSE sshfs so that cd /servers/<server> will automount the correct server with sshfs?

share|improve this question
up vote 1 down vote accepted

I just replied with an example answer to another question (autofs+sshfs-answer)

Remember! Autofs user by default is root. So get sshfs working with root first.

auto.master line

note! use your own uid and gid and specify your prefered mount point I use /auto/mehtod/address

/auto/sshfs /etc/auto.sshfs uid=1000,gid=1000,--timeout=60,--ghost

auto.sshfs this is a bit more generic than just one mount


# Shell script that acccepts one argument, namely userid@server
# env >> /tmp/env_check
# whoami >> /tmp/env_check

key=${key//[: #]/}

# add user
[[ ! "$key" =~ "@" ]] && key="${REMOTEDEFAULT}@${key}"

case $key in
      exit 1;;
      echo "-fstype=fuse,idmap=user,rw,nodev,nonempty,transform_symlinks,noatime,allow_other,IdentityFile=/home/${USER}/.ssh/id_dsa,max_read=65536\\"
      echo -e "\t /uhome :sshfs\#$key\:\\"
      echo -e "\t /tmp :sshfs\#$key\:\/tmp\/\\"
      echo -e "\t /rootfs :sshfs\#$key\:\/")

## this is a bit more complex. It creates subfolders to autofs-mount/remotename
## /uhome  = your remote homedirectory
## /rootfs = remote root '/'
## /tmp    = remote tmp # same as /roots/tmp

then link to folder you want to access ln -s /auto/sshfs/ remote-home

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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