Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

While I am able to mount a folder from a remote server using mount folder the entry in fstab is giving Connection reset by peer:

I have the following in my fstab

sshfs#username@remote:/folder/ folder fuse defaults,idmap=user 0 0

I have also configure trusted relationship between the remote server and the origin using public keys. and I am able to do ssh remote and authenticate without using a password.

Also, If I log in on the origin machine and use:

mount folder

the folder mounts succesfully.

Any suggestions?

Origin distro : 12.04 Remote server: 11.10

share|improve this question

2 Answers 2

sshfs needs a network connection. Maybe it is not set up at the time the ftsab mounts are executed. Never had problems with cable network but if I use wifi I have to mount it manually too. You also should add the _netdev parameter to your fstab. Otherwise the mount is waiting for a timeout and it will slow down your boot process.

share|improve this answer

Looks like your missing the -o identifyfile=

sshfs#username@remote:/folder/ folder -o identityfile=~/yourkeyfile  fuse defaults,idmap=user 0 0

also keep in mind your home dir will not be decrypted by this point so what I do is make a read only folder /keys for my keys

also, what I did to make things stupid simple was added sshfs to a python script and then in cron I put:

@reboot <username> /usr/bin/python /scripts/mounttheserver.py >> /scripts/servermount.log

Here is the python script:

#!/usr/bin/python

import os

os.system ("sshfs -o identityfile=<KEYFILE> <USERNAME>@<ADDRESS>:/storage /storage")

just make sure you +x it!

share|improve this answer

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.