Mounting Remote FIle System (IDE USAGE)

First let me say that many of these blog posts are here for my information as well as yours.

Going from a Windows Desktop environment to a Linux (Fedora) Desktop environment has its challenges. Going from the knowing to the unknown always involves a learning curve.

Whether you are a power user or web-developer, it makes no difference. You have reason to be able to connect to a remote system via SSH, or FTP to make changes to files. Many of us, not including myself any longer, use applications like SecureCRT to ssh directly into the server and use VIM to manipulate the files. Possibly we might use Zend Studio IDE and use their built in SSH/FTP to connect to the box to edit the files. Whatever method you are using on Linux, Unix there is a easier way.

REMOTE FILE SYSTEM MOUNTING!!!!

To connect to a remote file system securely, you can use sshfs and fuse together. Fuse is a command used to mount remote file systems encrypted through SSH.

Doing so, will allow you to modify files as if they were an additional drive on your system.

First, remember this only applies if your desktop environment is a Linux environment and NOT WINDOWS.

The packages that you will need are listed below:

1. sshfs
2. fuse-utils

These are the commands needed for the different types of packages. Also, you will need to be root in order to do these following steps.

STEP: 1

Debian:
apt-get install fuse-utils sshfs
Ubuntu:
sudo apt-get install fuse-utils sshfs
Fedora and Centos:
yum install fuse-utils sshfs
Mandriva: urpmi:
urpmi fuse-utils sshfs

STEP: 2
mount the fuse module

modprobe fuse (As usual, if Linux doesn’t complain when issued this command, then everything went fine)

STEP: 3
Create the mount point.

mkdir /mnt/remote-filesystem (This will just create a directory on the file system that will allow you to access the mounted file system as if it were available locally)

STEP: 4

chown user:user /mnt/remote-filesystem/

STEP: 5
Add yourself to the fuse group

adduser user fuse

All these steps should have been done as root.

Now, switch to the user that you are normally, I am assuming that you are not root all the time. Rather, I should say switch to the user that you bound to the fuse group.

HOW TO CONNECT TO THE REMOTE SYSTEM

sshfs remote-user@remote.server:/remote/directory /mnt/remote-filesystem/

This command explained:
sshfs – filesystem client based on ssh.
remote-user – the user you want to login as on the remote system.
@remote.server – the domain name or ip-address of the remote system.
:/remote/directory – the directory on the remote system that you would like to mount.
/mnt/remote-filesystem – the directory on your local box that you would like to point to the remote file system.

Once you issue this command, you will get a warning asking you to accept the key to connect to the server using ssh and then the password.
Upon being connected, you can cd to the /mnt/remote-filesystem directory and do a ls -ls and you will see that now you have access to the files on the remote system as if they were on your local machine.

One thing to keep in mind is that if your connection to the remote system is slow, file browsing and refreshing will be slow.

Once you are done with this feature, you can unmount the directory as follows:

$fusermount -u

for example, in my case, I would use
$fusermount -u /mnt/remote-filesystem

If you happen to get the following error:
fuse: bad mount point `/mnt/remote-fs/’: Transport endpoint is not connected
You will have to use the fusermount command as listed above and try reconnecting

Any questions or concerns, please let me know.

8 Responses

Subscribe to comments with RSS, or TrackBack to 'Mounting Remote FIle System (IDE USAGE)'.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>