Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

I'd simply go with

#!/bin/sh

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

and then put it in /etc/inittab

share|improve this answer

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.)

share|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

Your Answer

 
discard

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.