Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
6
rated 0 times [  6] [ 0]  / answers: 1 / hits: 16582  / 1 Year ago, sun, may 21, 2023, 5:31:05

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 [email protected]:/ /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.


More From » server

 Answers
6

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

[#32127] Monday, May 22, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
anatta

Total Points: 326
Total Questions: 128
Total Answers: 96

Location: Jordan
Member since Sun, Jun 26, 2022
2 Years ago
anatta questions
Sun, Jul 17, 22, 07:13, 2 Years ago
Sun, Jun 6, 21, 12:17, 3 Years ago
Sat, Jun 12, 21, 20:43, 3 Years ago
Thu, Jan 13, 22, 20:49, 2 Years ago
Sat, Jun 5, 21, 05:39, 3 Years ago
;