Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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

I've got an NAS file server on my local network, in my windows days I just mapped a drive to it and it was just there all the time. I'm having trouble doing the same in Ubuntu. I had done this successfully before using samba-cifs in fstab, but after reconfiguring the box that no longer works and it felt silly since the box itself runs Linux (Busybox I believe).

So at first I tried sshfs. I can access it from the Places -> Connect to Server using ssh, and it'll pull up in Nautilus. I can also mount it via commandline: sshfs -o idmap=user $USER@<localip>:/mnt/HD_a2 /media/nas-files and it works fine; however, it asks for a password so I can't add that in rc.local to mount on login. I've tried editing fstab, unsuccessfully, using this command:

sshfs#shazzner@<localip>:/mnt/HD_a2/files /media/nas-files/ fuse user 0 0

for some reason this turns the nas-files folder in a binary file, that appears to be garbage. When I unmount it, it comes back fine. No idea.

Second, someone in the chat mentioned, Autofs. I edited auto.master with:

/media/auto /etc/

and in

nfiles -fstype=fuse,rw,noperm,allow_other,reconnect sshfs\#//<localip>/mnt/HD_a2/files

then restarted autofs, it gives me no error message but the mount isn't there.

Pulling my hair out with this one, any help?

share|improve this question
up vote 6 down vote accepted

You can try to do a

sudo su
ssh-copy-id username@nas

to enable certificate based auto login for the user root.

Now the user root should be able to login to the server viva ssh without a password and i think sshfs now also does not need a password.

So you have to write a little script executing sshfs and start the script on startup (checkout the update-rc.d command)

share|improve this answer
Related: This Answer Explains Certificate based SSH login in more detail – Stefano Palazzo Jan 2 '11 at 9:01

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.