Using a combination of http://ubuntu-tutorials.com/2007/01/02/mount-remote-directories-securely-with-ssh-ubuntu-6061-610/ and http://www.tuxfiles.org/linuxhelp/fstab.html I figured I could mount the root of another computer to somewhere on my new laptop to make it easier to transfer files and stuff.

Now, I can connect through SSH and browser the files through an ad-hoc mount - but I would like to be able to do this automatically, and so had a look at fstab.

my new entry in fstab is:

remote_comp:/        /var/remote_comp     fuse    defaults       0        0

but testing with mount -a results in the following error:

/bin/sh: remote_comp:/: not found

I thought the problem was because I was trying to mount the root of the other computer, but even trying sub-directories result in the same error message.

link|improve this question

71% accept rate
feedback

2 Answers

First, you should use a folder like /mnt/remote OR /media/remote. /var is NOT for that purpose, you should leave it as it is.

Second, fstab should look like this:
sshfs#user@domain.org:/home/user /media/user fuse defaults,allow_other 0 0
OR
sshfs#llib@192.168.1.200:/home/llib/FAH /media/FAH2 fuse defaults 0 0
(Example is from the Arch howto.)

link|improve this answer
still problematic - it requested a password and then permissions were messed up... i'm just going to use the Gnome GUI options as they work fine – HorusKol May 18 '10 at 9:16
You could also write the line into /etc/rc.local. It will be executed at every boot and will mount the stuff if you give all the commands/permissions as arguments. – Shiki May 18 '10 at 9:53
feedback

I'd simply go with

#!/bin/sh

sshfs user@hostname:/path/to/folder /local/folder

and then put it in /etc/inittab

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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