Secure mounting of remote Linux/unix directories or file systems via SSHFS in Rhel-reproduced

Source: Internet
Author: User
Tags ssh server

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.