Redhat Enterprise Linux securely mount remote Linux / UNIX directory or file system using SSHFS
2010-08-17 12:05
501 查看
You can easily mount remote server file system or your own home directory using special sshfs and fuse tools.
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 are tested on CentOS, Fedora Core and RHEL 4/5 only. But instructions should work with any other Linux distro without a problem.
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 create their own file systems without the need to write any kernel code. This is achieved by running the file system code in user space, while the FUSE module only provides a "bridge" to the actual kernel interfaces. FUSE was officially merged into 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 are 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[/code]
Untar source code:# tar -zxvf fuse-2.6.5.tar.gz
Compile and Install fuse:# cd fuse-2.6.5 # ./configure # make # make installStep # 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 libraries such as libfuse.so.2:# vi /etc/ld.so.conf.d/fuse.conf
Append following path:/usr/local/lib
Run ldconfig:# ldconfigStep # 3: Install sshfs
Now fuse is 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[/code]
Untar source code:# tar -zxvf sshfs-fuse-1.7.tar.gz
Compile and Install fuse:# cd sshfs-fuse-1.7 # ./configure # make # make installMounting your remote filesystem
Now you have working setup, all you 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 vivek@rock.nixcraft.in: /mnt/remote
Where,
sshfs : SSHFS is a command name
vivek@rock.nixcraft.in: - 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/remoteFurther readings:
Visit the official FUSE website
Refer the man page of sshfs
摘自:http://www.cyberciti.biz/tips/rhel-centos-mounting-remote-filesystem-using-sshfs.html
相关文章推荐
- How to mount a remote directory in Linux using sshfs
- Mount a remote file system using sshfs and fuse - How to install sshfs
- 在android系统命令行中执行arm linux程序,出现/system/bin/sh: .xxx No such file or directory问题
- How to mount Windows share on Red Hat Enterprise Linux system using CIFS
- Using sshfs to mount remote directory
- UNIX/Linux下运行脚本文件出现bad interpreter:No such file or directory的原因和解决办法
- Get and display the size of file and directory in Linux system using du command 获取和现实linux文件大小(三)
- busybox filesystem ts_config: No such file or directory
- Using the Oracle ASM Cluster File System (Oracle ACFS) on Linux, Part One
- qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt5/bin/qmake': No such file or directory
- linux升级内核,出现:mount:could not find filesystem‘/dev/root’的解决方法
- fatal: Not a git repository (or any parent up to mount parent /media) Stopping at filesystem boundar
- linux java jdk环境变量设置之后,依旧提示 No such file or directory
- LINUX 出现ERROR OPENSSLSSL.H NO SUCH FILE OR DIRECTORY的解决方法
- Remote Mount a VMDK File Using vmware-mount
- linux下/dev/dsp:No such file or directory解决方法
- qmake: could not exec ‘/usr/lib/x86_64-linux-gnu/qt4/bin/qmake’: No such file or directory
- [ARM笔记]error: arm-none-linux-gnueabi-gcc: No such file or directory
- 自己编写的linux的service脚本启动报错:No such file or directory
- [Linux][ubuntu][Perl]bad interpreter: No such file or directory