Difference between revisions of "SSHFS"

From ArchWiki
Jump to: navigation, search
(Connection reset by peer)
Line 38: Line 38:
 
===Connection reset by peer===
 
===Connection reset by peer===
 
* If you are trying to access the remote system with a hostname, try using its IP address, as it can be a domain name solving issue. Make sure you edit /etc/hosts with the server details.
 
* If you are trying to access the remote system with a hostname, try using its IP address, as it can be a domain name solving issue. Make sure you edit /etc/hosts with the server details.
 +
* Adding the option 'sshfs_debug' (as in 'sshfs -o sshfs_debug user@server ...') can help in resolving the issue.
 +
* If you're trying to sshfs into a router running DD-WRT or the like, there is a solution [http://www.dd-wrt.com/wiki/index.php/SFTP_with_DD-WRT here].
 
* Forum thread: [http://bbs.archlinux.org/viewtopic.php?id=27613 sshfs: Connection reset by peer]
 
* Forum thread: [http://bbs.archlinux.org/viewtopic.php?id=27613 sshfs: Connection reset by peer]
  
 
==See also==
 
==See also==
 
* [[SSH]]
 
* [[SSH]]

Revision as of 16:09, 7 September 2008

You can use sshfs to mount a remote system - accessible via ssh - to a local folder. So You will be able to do any operation on the mounted files with any tool (copy, rename, edit with vim, etc.).

To install the needed packages, do:

pacman -S sshfs

This should install fuse and sshfs, and maybe other packages.

You will use the command sshfs to mount, but first a kernel module should be loaded, so as root, do:

modprobe fuse

(You can put fuse into the module-list of /etc/rc.conf to auto-load at boot.)

To mount a remote directory:

sshfs USERNAME@HOSTNAME_OR_IP:/PATH LOCAL_MOUNT_POINT SSH_OPTIONS

for example:

sshfs sessy@mycomputer:/home/sessy /mnt/sessy -C -p 9876

Where 9876 is the port number.

Also, make certain that before connecting, you set the file permissions for any local client folders you will attempt to mount a remote directory to. I.e., don't have everything owned by root!

SSH will ask for the password, if needed.
If You don't want to type in your password 49 times a day, than read this: How to Use RSA Key Authentication with SSH

To unmount the remote system:

fusermount -u LOCAL_MOUNT_POINT
fusermount -u /mnt/sessy

Tip: to quickly mount a remote dir, do some file-management and unmount it, put this in a script:

sshfs USERNAME@HOSTNAME_OR_IP:/PATH LOCAL_MOUNT_POINT SSH_OPTIONS
mc ~ LOCAL_MOUNT_POINT
fusermount -u LOCAL_MOUNT_POINT

This will mount the remote directory, launch MC, and unmount it when You exit.

Common issues

Connection reset by peer

  • If you are trying to access the remote system with a hostname, try using its IP address, as it can be a domain name solving issue. Make sure you edit /etc/hosts with the server details.
  • Adding the option 'sshfs_debug' (as in 'sshfs -o sshfs_debug user@server ...') can help in resolving the issue.
  • If you're trying to sshfs into a router running DD-WRT or the like, there is a solution here.
  • Forum thread: sshfs: Connection reset by peer

See also