Mounting ssh shares for local access on ubuntu

By ranjanp at 1 August, 2008, 9:03 pm

I wanted to access my folders at my hosting provider for local access on my system. It’s very simple using just a few commands and viola, local access to remote ssh folders. Why ssh? well it’s secure. Why access localy? My personal machine does offer me lots more tools including my favorite editor - vim

So here’s what you got to do. BTW I am running 8.04 - hardy heron.

Check that your system is using the fuse kernel module. Well what is FUSE you ask? FUSE stands for Filesystem in Userspace. It’s a cool technology for linux where you can mount various filesystems in user mode! It implements a thin kernel abstraction so that all the filesystem fun can be moved to userspace. Here’s how you can check

#lsmod|grep fuse

fuse                   50708  5

if you do not see fuse show up above then you need to install the module.

#sudo modprobe fuse

#sudo adduser fuse

#sudo chown root:fuse /dev/fuse

#sudo chmod +x /dev/fusermount

On my Ubuntu 8.04, I have fuse already setup and running so none of the above steps are needed. Next you install the sshfs package

sudo apt-get install sshfs

Now create a folder in you home where you want the remote folder to be be visible. Let’s call it remoteFun

mkdir remoteFun

Now all you need is a simple sshfs invocation

sshfs <username>@<remote host>:<remote path to mount root/sub folder is ok> remoteFun

That’s it, now enter your password for the remote machine and you have access to the remote contents inside remoteFun

cd remoteFun

ls .

Just watch out if you are providing a sub folder path in the remote host, you may have symlinks that may not work in your local mount.

Sphere: Related Content

Related Posts

Categories : Linux