You are not logged in.

#1 2007-10-05 14:54:04

nogoma
Member
From: Cranston, RI
Registered: 2006-03-01
Posts: 217

sshfs in a NAS?

I'm debating put together a small home NAS to share some data between my various computers. Up until now, I've been using sshfs to mount drives between individual machines, and have had quite a good experience of it. My question is whether or not sshfs is appropriate for using "larger scale"; mount the same directory to multiple (4-5) machines, and keeping it mounted? I don't necessarily have anything against using NFS, but as I've said I've used sshfs and it works well for me on a small scale. I guess my concern w/ sshfs is whether or not it handles/deals with multiple access intelligently.


-nogoma
---
Code Happy, Code Ruby!
http://www.last.fm/user/nogoma/

Offline

#2 2007-10-29 15:36:20

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,896
Website

Re: sshfs in a NAS?

Hi I am trying to set up sshfs to link laptop and desktop [but without being open to the web] just need to access router [port forward maybe!]

read wiki pages but I an unsure if I need to set up ssh and sshfs? very confusing

sorry as for NFS we talking samba here ?


Mr Green

Offline

#3 2007-10-29 15:53:14

nogoma
Member
From: Cranston, RI
Registered: 2006-03-01
Posts: 217

Re: sshfs in a NAS?

sshfs requires a couple of things. First, you need to be running sshd (the ssh server) on the machine you want to get the data from (in your case, I would imagine this is your desktop). This makes sense for me since I run sshd on my main box already. Next, you need to install fuse (from core) and sshfs (from extra) on the machine you want to see the data on (so, your laptop). You can then do:

mrgreen@laptop:~$ mkdir clever_data_dir_name
mrgreen@laptop:~$ sshfs mrgreen@desktop:/folder/you/want/to/get/at clever_data_dir_name

This will make the data in /folder/you/want/to/get/at on your desktop available on your laptop in the directory "clever_data_dir_name" like it was a normal directory. That is, you can navigate it like normal, cp, rm, mv files, etc. Tools like df and whatnot tend to get confused by it, but that's never been an issue for me. Anyway, I find this to all be very useful given my existing ssh setup (ssh keys, etc.), but perhaps is more work than you want if you don't already run sshd.

As for NFS, it stands for "networked filesystem", and is actually different from samba. I believe there is a bit of configuration for this (basically, on your desktop you'd "export" the desired data via nfs, and mount it on your laptop), but you should look at http://wiki.archlinux.org/index.php/Nfs for real information. All in all, if you're just looking to copy data back and forth, you might be just as happy with samba (especially if there are windows machines in the mix).

PS For people looking to use something like sshfs to mount data onto windows machines, I've recently started using sftpdrive on my fiancee's windows laptop with good effect. It basically allows you to mount a folder via ssh to a mapped network drive in windows. It's for-pay, but nothing too expensive and quite good at what it does.


-nogoma
---
Code Happy, Code Ruby!
http://www.last.fm/user/nogoma/

Offline

#4 2007-10-29 16:11:47

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,896
Website

Re: sshfs in a NAS?

Wow thanks for that :-)

I need to port forward [guess!] to get access to Desktop, sshfs would do the trick as I just need to grab media and configs from Desktop ... [atm!]

pacman -Q | grep ssh
openssh 4.7p1-2
sshfs 1.8-1
[ ~ ] > pacman -Q fuse
fuse 2.7.1-1
[ ~ ] >

mrgreen@laptop yeah ok lol.... I get the idea sshfs is installed on laptop so ...

reading wiki I need to add stuff to hosts.allow? could I just add mrgreen@laptop?

Last edited by Mr Green (2007-10-29 16:12:12)


Mr Green

Offline

#5 2007-10-29 17:53:24

nogoma
Member
From: Cranston, RI
Registered: 2006-03-01
Posts: 217

Re: sshfs in a NAS?

Mr Green wrote:

Wow thanks for that :-)

I need to port forward [guess!] to get access to Desktop, sshfs would do the trick as I just need to grab media and configs from Desktop ... [atm!]

Well, I don't know the exact layout of your network, but this shouldn't be necessary in regards to your LAN. port forwarding is generally for connections coming from the WAN (internet) side of your network. For example, if you're running two web servers on two different machines inside your network, you might configure your router to redirect traffic from the internet on port 80 to one machine and port 8080 to the other. So, again, for your case of all the traffic being internal to your network (all on the same subnet (i.e. all the machines have addresses like 192.168.0.XXX or what have you)) I don't believe you'd need port forwarding. By default, sshd will run on port 22, and sshfs will try to connect via port 22. Of course, if you want to be able to ssh into your box from the internet, you'd THEN need to port forward 22 from your router to your desktop. However, note that if you're a little uncertain on what this entails, you would do well to ask more questions and read a bit, since you'd be opening up your box to the internet (so, you'd want to have a good password, probably disable root login via ssh, etc, etc). There are plenty of guides in the forums, wiki, and google if you do have more questions about doing this.

Mr Green wrote:
pacman -Q | grep ssh
openssh 4.7p1-2
sshfs 1.8-1
[ ~ ] > pacman -Q fuse
fuse 2.7.1-1
[ ~ ] >

mrgreen@laptop yeah ok lol.... I get the idea sshfs is installed on laptop so ...

reading wiki I need to add stuff to hosts.allow? could I just add mrgreen@laptop?

I unfortunately don't have access to my arch box at this second, but with my configuration (which I don't believe is the default), I add my username as a valid user in my sshd_config, and add the machines I want that user to be able to connect from to hosts.allow. I don't believe you can specify user names in hosts.allow (this file just allows or rejects connections from machines, afaik, and as such username information would never be passed). Basically, if you can ssh from your laptop to the desktop, that's all you need for sshfs to work. To further simplify the whole procedure, you can look at ssh keys, and tools like keychain.


-nogoma
---
Code Happy, Code Ruby!
http://www.last.fm/user/nogoma/

Offline

#6 2007-10-29 21:35:54

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,896
Website

Re: sshfs in a NAS?

I was getting confused of course you forward ports to allow access to say server to internet I just want to connect to Desktop via my router .... looking at guides now

Bear with me I have only just got my wireless network set up....

/me goes off in search of ssh .....

Thanks for all your help [sorry to hijack your thread!]

MrG


Mr Green

Offline

#7 2007-11-01 20:22:45

daf666
Member
Registered: 2007-04-08
Posts: 470
Website

Re: sshfs in a NAS?

Hi there nogoma, to answer your original question, your best bet is to go for NFS/Samba.
Think about all of the encrypting and decrypting the CPU's in your LAN will have to face while downloading flies, especially the slow machines and when sharing large files (using sshfs).
Take the time, and optimize + secure your NFS/Samba NAS as best as it can be.

Over WAN though shfs is attractive! gonna try it myself soon.

Last edited by daf666 (2007-11-01 20:25:24)

Offline

#8 2007-11-15 23:37:46

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: sshfs in a NAS?

From what I've read SSH doesn't scale well when compared to SMB/NFS connections, which is one of the reasons that NFS is so common in enterprise environments.  That's not to say that SSH isn't good--it's the only protocol I like to use, be it LAN or WAN--it's just that's it's not as scalable or resource-friendly as say NFS.


thayer williams ~ cinderwick.ca

Offline

#9 2008-04-19 09:28:52

daf666
Member
Registered: 2007-04-08
Posts: 470
Website

Re: sshfs in a NAS?

I recently am always copying stuff (large files) from my Arch fit-pc (an 500mhz appliance PC) to my Arch desktop,  this setup doesnt qualify for a NAS but I have interesting speed results:

1. when using sftp://server/file I get 2-3 MB per second, I lived with that for a while.. this is probably due to the slow fit-pc CPU (encryption costs)

2. using cp from an NFS mount I get 7-8 MB per second.

3. using ftp://server/file i get 11 MB per second!

All my methods are seamless when using in Konqueror..
in conclusion.. vsftpd wins when you need simple transfers in a lan.

Offline

Board footer

Powered by FluxBB