In order to mount remote SSH folders from Ubuntu/Kubuntu client PC you need to do the following
- Code: Select all
sudo apt-get install sshfs
Now we will use the modprobe command to load it
- Code: Select all
sudo modprobe fuse
Now you need to set up some permissions in order to access the utilities.
Replace with your username.
- Code: Select all
sudo useradd -G fuse yourusername
sudo chown yourusername:fuse /dev/fuse
sudo chmod +x /usr/bin/fusermount
Create the mountpoints
- Code: Select all
sudo mkdir /mnt/sshfs
mkdir /mnt/sshfs/remotedirname
IMPORTANT: Do NOT use sudo in the last command!
Now edit /etc/fstab and add the following in this format,
pay attention to replace the uid and gid with your user uid and gid.
(ALL IN ONE LINE!)
- Code: Select all
# <file system> <mount point> <type> <options>
sshfs#[email protected]:/home/yourusername /mnt/sshfs/remotedirname fuse comment=sshfs,users,noauto,uid=1000,gid=1000,allow_other,reconnect,transform_symlinks 0 0
Next, you should put the following in /etc/fuse.conf (create the file if it doesn't exist):
- Code: Select all
user_allow_other
To see if your fstab entry works, open up a terminal and try to mount it like this
- Code: Select all
mount /mnt/sshfs/remotedir
Then see if your sshfs share has been successfully mounted, for example, by:
- Code: Select all
ls /mnt/sshfs/remotedir
You should see your remote files (DUH!)
Notice that even the entry is in /etc/fstab the system won't mount
the remote folder automatically, because it would do it as root, not as user
and that would make the folders unavailable for the regular user,
so the way to mount it as user is to add a Gnome or KDE startup session
command that mounts the folder after logged in.
Because the mount point is in fstab, you'll get an icon of the remote folder in your desktop.
Hope it helps and that you find it useful!
Enjoy,
Ziv