Sshfs (ssh filesystem)

Posted on: November 3, 2010

Sshfs is a filesystem client based on the SSH File Transfer Protocol.
On the server side there’s nothing to do. On the client side mounting the filesystem is as easy as logging into the server with ssh.

On the client side, where you want to mount the filesystem.
1. You need to install next packages:

# apt-get install fuse-utils sshfs

2. You have to create a mount directory:

# mkdir --parents /mnt/sshfs

3. Give access permission to mount directory.

#chown user:group /mnt/sshfs
#chmod 755 /mnt/sshfs

  • user: who have permission to mount /mnt/sshfs.
  • group: which is part the user.
  • 4. Add user to fuse group.

    # adduser user fuse

    5. You can check fuse permissions. It should show something like that:

    $ ls -l /dev/fuse
    crw-rw---- 1 root fuse 10, 229 ago 27 17:00 /dev/fuse

    How to use sshfs?
    1. Mount filesystem

    $sshfs user@remote_host:/music /mnt/sshfs

    2. Unmount filesystem

    $fusermount -u /mnt/sshfs

    Sshfs has many optional parameters, whose are pretty nice 🙂

    -o reconnect
    reconnect to server

    -o sshfs_sync
    synchronous writes

    -o no_readahead
    synchronous reads (no speculative readahead)

    -o sshfs_debug
    print some debugging information

    -o cache=YESNO
    enable caching {yes,no} (default: yes)

    -o cache_timeout=N
    sets timeout for caches in seconds (default: 20)

    -o cache_X_timeout=N
    sets timeout for {stat,dir,link} cache


    Leave a Reply

    Fill in your details below or click an icon to log in: Logo

    You are commenting using your account. Log Out /  Change )

    Google photo

    You are commenting using your Google account. Log Out /  Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out /  Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out /  Change )

    Connecting to %s


    • None
    • analialorenzatto: Buzz is just a host name for this example, it doesn't have any relation to the topic. Instead of being "Buzz", could be whatever name.
    • fridelain: >buzz What's the story behind this host name? Actully running buzz, once running buzz and upgraded many times since, or unrelated to debian naming
    • Pratik: Nice, but I would change it to include more directories. Like my .mozilla and .kde4 by using .{config,mozilla,kde4} instead of just .config .


    %d bloggers like this: