You can easily mount remote server file system or your own home directory using special SSHFS and fuse tools.
Fuse-filesystem in userspace
FUSE is a Linux kernel module also available for FreeBSD, OpenSolaris and Mac OS X that allows non-privileged users to CRE Ate their own file systems without the need to write any kernel code. This was achieved by running the file system code in user space and while the FUSE module was only provides a "bridge" to the ACTU Al kernel interfaces. FUSE was officially merged to the mainstream Linux kernel tree in kernel version 2.6.14.
You need to use SSHFS to access to a remote filesystem through SSH or even you can use Gmail account to store files.
Following instructions is tested on CentOS, Fedora Core and RHEL 4/5 only. But instructions should work with any other Linux distro without a problem.
Step # 1:download and Install FUSE
Visit fuse home page and download latest source code tar ball. Use wget command to download fuse package:
# wget http://superb-west.dl.sourceforge.net/sourceforge/fuse/fuse-2.6.5.tar.gz
Untar Source code:
# tar -zxvf fuse-2.6.5.tar.gz
Compile and Install Fuse:
# cd fuse-2.6.5
# ./configure
# make
# make install
Step # 2:configure Fuse shared libraries loading
You need to configure dynamic linker run time bindings using Ldconfig command so that SSHFS command can load shared Librar ies such as libfuse.so.2:
# vi /etc/ld.so.conf.d/fuse.conf
Append following path:
/usr/local/lib
Run Ldconfig:
# ldconfig
Step # 3:install SSHFS
Now fuse was loaded and ready to use. Now you need SSHFS to access and Mount file system using SSH. Visit SSHFS home page and download latest source code tar ball. Use wget command to download fuse package:
# wget http://easynews.dl.sourceforge.net/sourceforge/fuse/sshfs-fuse-1.7.tar.gz
Untar Source code:
# tar -zxvf sshfs-fuse-1.7.tar.gz
Compile and Install Fuse:
# cd sshfs-fuse-1.7
# ./configure
# make
# make install
Mounting your remote filesystem
Now your has working setup, all of need to do is mount a filesystem under Linux. First create a mount point:
# mkdir /mnt/remote
Now mount a remote server filesystem using SSHFS command:
# sshfs [email protected]: /mnt/remote
Where,
- SSHFS : SSHFS is a command name
- [email protected]: -Vivek is SSH username and rock.nixcraft.in is my remote SSH server.
- /mnt/remote : a local mount point
When promoted supply vivek (SSH user) password. Make sure you replace username and hostname as per your requirements.
Now you can access your filesystem securely using Internet or your Lan/wan:
# cd /mnt/remote
# ls
# cp -a /ftpdata . &
To unmount file system just type:
# fusermount -u /mnt/remote
Or
# umount /mnt/remote