Dave's Brain

Browse - Computer Tips - How can I mount a remote filesystem via ssh?

Date: 2017feb6
OS: Linux
Distro: RedHat/Fedora/CentOS

Q.  How can I mount a remote filesystem via ssh?

A.  Use sshfs.  This is a FUSE filesystem.

dnf install sshfs
Make a mount point:
mkdir /mnt/otherhost
sshfs user@otherhost.com:/home/user /mnt/otherhost_user
You may want to add some options:
sshfs -o 'noexec,follow_symlinks' user@otherhost.com:/home/user /mnt/otherhost_user
You can use the mount command to mount if you want:
mount -t fuse.sshfs user@otherhost.com:/home/user /mnt/otherhost_user
You'll be asked for the password and that's it.
ls -l /mnt/otherhost_user
Unmount like any other filesystem:
umount /mnt/otherhost_user

Add a comment

Sign in to add a comment
Copyright © 2008-2018, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.