Howto: mounting remote folder using ssh with fstab

Posted on

Mostly I suggest nfs for network share and it is easy to share over network, also for windows I use samba services, Here I found the suitable solution for remote share mount with out setup any server file share services. We can directly mount folders using SSH , so fuse is working behind this.

For this kind of setup you need to install few packages listed below

fuse-2.7.4-8.el5.i386.rpm  
fuse-libs-2.7.4-8.el5.i386.rpm  
fuse-sshfs-2.4-1.el5.i386.rpm

Direct download package repositories,

ftp://195.220.108.108/linux/centos/5.10/os/i386/CentOS/

Installation steps :

cd /home/downloads
wget ftp://195.220.108.108/linux/centos/5.10/os/i386/CentOS/fuse-libs-2.7.4-8.el5.i386.rpm
wget ftp://195.220.108.108/linux/epel/5/i386/fuse-sshfs-2.4-1.el5.i386.rpm
wget ftp://195.220.108.108/linux/centos/5.10/os/i386/CentOS/fuse-2.7.4-8.el5.i386.rpm
rpm -ivh fuse*.rpm

Password-less authentication

ssh-copyid -i ~/.ssh/id_rsa.pub anand@192.168.1.6

Mounting fstab entries like this

vi /etc/fstab
sshfs#anand@192.168.1.6:/backup/ISO-files /mnt/ISO fuse delay_connect,idmap=user,uid=1000,gid=1000,umask=0,allow_other,_netdev,workaround=rename 0 0

Save the fstab an make it auto moutn

mount -a

Now execute “mount” command, so you can see the entries like this.

none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
root@192.168.1.6:/backup/ISO-files on /mnt/ISO type fuse.sshfs (rw,nosuid,nodev,allow_other)

Enjoy the share.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s