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.

i'm trying to use sshfs on ubuntu. i have root access on the server i'm trying to connect to. but everytime i try to connect using my ubuntu laptop, the message i get is the following:

  cp@cp-AOA150:/$ sudo sshfs root@myserver:/ /home/cp/Documents/myserverfolder/
  read: Connection reset by peer
  cp@cp-AOA150:/$ 

i'm not too familiar with ubuntu / linux but could the problem be that the key that's on the server is not for the user "cp"?
If this is the case, how do i set up the root account on ubuntu?

any suggestions would be appreciated.

btw. i can ssh into the box no problems, but as root. so in other words, this works:

  ssh root@myservername

i've copied over my key file from work onto this new laptop. it's just sshfs that isn't happy right now. thanks.

EDIT 1

When I run sshfs with debug options like so:

  cp@cp-AOA150:~$ sshfs -o sshfs_debug -p 22 root@10.14.5.182:/ /home/cp/Documents/myserverfolder/

I get the following error message:

  SSHFS version 2.4
  fusermount: user has no write access to mountpoint /home/cp/Documents/myserverfolder/
  cp@cp-AOA150:~$ 

I've checked the permissions on the folder myserverfolder and it looks like this: (results of ls -la command)

   drwxr-xr-x 2 root root 4096 Mar 19 17:11 .
   drwxr-xr-x 4 cp   cp   4096 Mar 19 17:11 ..

Edit 2

I've ensured that the user cp is a part of the fuse group.

  cp@cp-AOA150:~$ sudo addgroup cp fuse
  [sudo] password for cp: 
  The user `cp' is already a member of `fuse'.
  cp@cp-AOA150:~$ 

Edit 3

Results of ls -ld

  cp@cp-AOA150:~$ ls -ld /home/cp/Documents/myserverfolder
  drwxr-xr-x 2 root root 4096 Mar 19 17:11 /home/cp/Documents/myserverfolder
  cp@cp-AOA150:~$ 

I'm not too familiar yet with linux but i did try to create a file in this folder using vim. I wasn't able to save the file... I think I created the folder using the "sudo " prefix to the mkdir command... because when i try without sudo, i get a "permission denied" error message. I'm going to google "chmod" to see how i can grant permissions to cp on this folder.

share|improve this question
    
So you login with the key or with a password? –  Meer Borg Mar 19 '13 at 22:41
    
And if you run sshfs without sudo? Where did you put your key file? –  Eric Carvalho Mar 19 '13 at 23:04
1  
Can you really write to the mountpoint? Could you try it? What's the output of ls -ld /home/cp/Documents/cadev01 (or whatever mount point you're using now...)? –  phoibos Mar 20 '13 at 0:19
    
phoibos.. please check out edit 3 –  dot Mar 20 '13 at 0:27
1  
The mount point must be writeable by the user and empty. For the sake of testing, create a new mount point mkdir ~/mnttest and run sshfs -o sshfs_debug -p 22 root@10.14.5.182:/ ~/mnttest –  phoibos Mar 20 '13 at 1:10

1 Answer 1

up vote 2 down vote accepted

Some ideas:

  • The root account on your local system doesn't have to do anything with the account you use on the remote system. Don't run sshfs with sudo! Besides, sshfs is a user space file system
  • Assuming you use ssh keys, did you copy your public key to the remote system? ssh-copy-id -i ~/.ssh/id_rsa.pub root@myserver
  • Maybe the port for ssh is different than the standard port 22? Use the -p option of sshfs
  • Use the debug option of sshfs: -o sshfs_debug
  • Is login with ssh as root on the server possible at all? Some distros disable this by default.
  • The user must be a member of the fuse group: sudo addgroup YOUR_USER fuse
  • The mount point must be writeble by the user and empty

Example:

mkdir ~/mnttest
sshfs -o sshfs_debug -p 22 root@myserver:/ ~/mnttest

Unmounting:

fusermount -u ~/mnttest
share|improve this answer
    
when i run that command, i get the following error message: SSHFS version 2.4 fusermount: user has no write access to mountpoint /home/cp/Documents/myserverfolder/ cp@cp-AOA150:~$ –  dot Mar 19 '13 at 23:53
    
I've updated my post to make the error message clearer. –  dot Mar 19 '13 at 23:56
    
my user is already added. check out edit 2. –  dot Mar 20 '13 at 0:10

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.