http://fedorasolved.org/server-solutions/sshfs

SSHFS

by strikeforce last modified Mar 10, 2008 12:52 PM
— filed under: Server Solutions

The idea of sshfs was taken from the SSHFS filesystem distributed with LUFS, which I found very useful. There were some limitations of that codebase, so I rewrote it. Features of this implementation are: * Based on FUSE (the best userspace filesystem framework for linux ;-) * Multithreading: more than one request can be on it's way to the server * Allowing large reads (max 64k) * Caching directory contents This install will explain how to install and mount sshfs. It will give examples of how to mount on boot using the /etc/fstab

Applicable to Fedora Versions

  • Fedora Core 7+

Requirements

  1. You must have Fedora Extra's as a repository
  2. You must have a ssh server to test this on

Doing the Work

  1. You will need to install sshfs:
  2. su -c 'yum install fuse-sshfs'
      
  3. The user needs to be added to group fuse:
  4. su -c 'gpasswd -a yourusername fuse'
  5. How to mount it (Remeber to change it to your specific settings):
  6. sshfs [email protected]: yourmountpoint/
  7. To unmount:
  8. fusermount -u yourmountpoint/

The next bits are your choice and are not required for SSHFS to function

  1. We will set it up so that it automatically mounts on boot using fstab:
  2. su -c 'gedit /etc/fstab'
  3. You will need to add this line:
  4. sshfs#[email protected]:/home/myname    /mnt/sshfs/homebox    fuse    comment=sshfs,noauto,users,exec,uid=1000,gid=1000,allow_other,reconnect,transform_symlinks,BatchMode=yes

Troubleshooting

How to test

  1. If you get a fusermount denied error you may need to set sshfs to SUID:
  2. su -c 'chmod u+s /usr/bin/sshfs'
      
  3. You may get issues with SELinux you can either disable it or set it to permissive:
  4. su -c 'gedit /etc/selinux/config'
    Then Change it to the following:
    # This file controls the state of SELinux on the system.
    # SELINUX= can take one of these three values:
    #       enforcing - SELinux security policy is enforced.
    #       permissive - SELinux prints warnings instead of enforcing.
    #       disabled - SELinux is fully disabled.
    SELINUX=permissive
    # SELINUXTYPE= type of policy in use. Possible values are:
    #       targeted - Only targeted network daemons are protected.
    #       strict - Full SELinux protection.
    SELINUXTYPE=targeted
    
    # SETLOCALDEFS= Check local definition changes
    SETLOCALDEFS=0 
      

Common problems and fixes

More Information

 

Disclaimer

We test this stuff on our own machines, really we do. But you may run into problems, if you do, come to #fedora on irc.freenode.net

Added Reading


Reply via email to