Changes between Version 3 and Version 4 of SSHFS


Ignore:
Timestamp:
04/02/2019 11:26:18 (5 years ago)
Author:
/C=FR/O=CNRS/OU=UMR5821/CN=Pascal Meyrand/emailAddress=pascal.meyrand@…
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SSHFS

    v3 v4  
    1111
    1212== SSHFS on Linux ==
    13 '''For Debian-like distribution :'''
     13'''For Fedora distribution :'''
     14Uniquement pour le PC portable, les postes fixes montent les filesystem via NFS
    1415
    1516'''Installation and Setup'''
    1617
    17 Simply install the following package:'' sshfs'', then add yourself to the fuse group:
     18Simply install the following package:'' sshfs'':
    1819
    1920{{{
    20 sudo gpasswd -a $USER fuse
     21sudo dnf install fuse -y
     22sudo dnf install sshfs -y
    2123}}}
    2224
    2325Si vous ne disposez pas des droits sudo, merci d'envoyer un mail à support@lpsc.in2p3.fr
    2426
    25 Alternatively, GNOME users can go to System -> Administration -> Users and Groups -> (your user) -> Properties -> User Privileges, then tick the following option:
    26 
    27 Allow use of fuse filesystems like LTSP Thin Client blockdevices
    28 
    29 Adding yourself to the fuse group lets you use the fusermount command, which is needed by the FUSE userland filesystem utility.
    30 
    31 Once you have added yourself to the fuse group, you should log out and log back in again for the change to take effect.
    32 
    3327'''Command-line Usage'''
    3428
    35 Now, assuming that you have an SSH server running on a remote machine, simply run the SSHFS command to mount the remote directory. In this example, the remote directory is /projects on remote host far. The local mount point is ~/far_projects.
    3629
    3730{{{
    38 mkdir ~/far_projects
    39 sshfs -o idmap=user $USER@far:/projects ~/far_projects
     31sudo mkdir /"nom du point de montage"
     32ls -als /home/username (pour visualiser UID:GID)
     33chown UID:GID /"nom du point de montage"
     34sshfs username@lpsc-ssh.in2p3.fr:/"nom du volume à monter" (par exemple /informatique) /"nom du point de montage"
     35password (celui de ssh)
     36df (le disque doit être vu)
    4037}}}
    4138
    4239To unmount :
    4340{{{
    44 fusermount -u ~/far_projects
     41sudo umount /"nom du point de montage"
    4542}}}
    4643
    47 To add it to your /etc/fstab (if you want your remote directory to be mounted when you start your computer),
    48 
    49 {{{
    50 sshfs#$USER@far:/projects /home/$USER/far_projects fuse defaults,idmap=user 0 0
    51 }}}
    52 
    53 Note that you have to change $USER to your login name when editing fstab, but it is not necessary when typing commands (the shell does it for you in that case).
    54 
    55 One thing to be aware of is that your UID (User ID, the unique number of your user on a system) is not necessarily the same on the two hosts. When you ls -l, the user name associated with each file is printed in the third column. However, in the filesystem, only UIDs are stored, and ls simply looks up the UID and finds the user name associated with it. In Unix, UIDs are what matter, not the user names. So if you're 1000 on the local host and 1003 on the remote host, the sshfs mounted directory would show a different user name for your files. This is not a problem, though, because the ssh server on the remote machine is what is actually reading and writing files. So even though it shows up in ls -l as a different UID, any changes will be done through the ssh server on the remote host, which will use the correct UID for the remote machine. Problems may arise if you attempt to use a program that looks at UIDs of files (e.g. ls prints the wrong user name).
    56 
    57 The idmap=user option ensures that files owned by the remote user are owned by the local user. If you don't use idmap=user, files in the mounted directory might appear to be owned by someone else, because your computer and the remote computer have different ideas about the numeric user ID associated with each user name. idmap=user will not translate UIDs for other users.
    58 
    59 '''Keep Alive'''
    60 
    61 Your ssh session will automatically log out if it is idle. To keep the connection active (alive) add this to ~/.ssh/config or to /etc/ssh/ssh_config on the client.
    62 {{{
    63 ServerAliveInterval 5
    64 }}}
    65 This will send a "keep alive" signal to the server every 5 seconds. You can usually increase this interval, and I use 120.
    6644
    6745== SSHFS on MACOS ==