Better protocol choice than SSH for home NAS with raspberry pi

0

0

Setup:

  • I have a raspberry pi 3 at home, with raspian installed on it.
  • Connected to it are two different usb hard drive (powered separately), with one being scheduled to regularly mirror the other using a cronjob with rsync.
  • I opened a port on my router to access it over the internet via ssh (I often need it outside of my home), and use a private key instead of a password to authenticate myself.

Right now, I use this setup as some kind of homemade NAS (because it is cheaper than buying one, and it entertains me to do it myself), and I mount the drives using sshfs on Linux (using SSHFS) and windows (using SFTP netdrive).

I have scheduled backups of my Linux system files using backintime, and I also host some of my media files (mostly movies and important documents) on it for access anywhere.

I am aware of (most of) my setup bottlenecks, being the in order:

  1. the hard drive speed
  2. the usb port
  3. the processing power of the raspberry pi
  4. the speed of my home network
  5. the speed of the internet from where I access my data

The question:

Right now everything is working fine, but it is slow, and I am also concerned about the security flaw of my setup.

For this and my own curiosity, I would like to know if there is a faster and/or safer way to do this, ignoring the obvious bottlenecks I listed above, since most of them I could upgrade.

Thank you for the help !

yves03

Posted 2019-06-25T12:02:35.737

Reputation: 1

I’m sure you know about Samba. Why did you not use it? It’s the most popular option with Windows. – Daniel B – 2019-06-25T12:08:35.883

What is slow about it? – Seth – 2019-06-25T12:16:06.033

@DanielB I know about Samba, but it is not as simple to use on Linux. Is there an advantage to use it over ssh ? – yves03 – 2019-06-25T13:27:50.617

@Seth When I try to read a media file using a good connection, my VLC player regularly buffers, and interrupts the movie I'm watching. There is also the security aspect I am not sure about. – yves03 – 2019-06-25T13:29:16.940

I found this thread on reddit which does a good job of comparing the solutions but doesn't give me a clear answer

– yves03 – 2019-06-25T13:52:14.400

How so? They're telling you it's a bad protocol to use for file sharing as that's not really what SSH was built for. Also if you already know that your bullet points 1-5 are a problem changing the protocol won't fix them. Also "good connection" and "media file" are very general. Depending on where you are a GRPS connection might be good but playing a 4K x264 is still going to be impossible. Did you check your system load? Your disk load? Your connection speed? Did you try to run the numbers of whenever your connection speed is sufficient? As for security your system is as secure as SSH is. – Seth – 2019-06-26T09:16:17.850

@Seth Some of the comments do not agree on the SSHFS not being adapted part. Also my bullet points list possible problems. My system load is low, my connection speed should be good (tested them in early morning). I don't think my hdd are being overloaded but that's something I need to check.

Still, I think I will take the advice from DanielB and and the reddit thread and use Samba along with an openvpn connection to access it from outside of my network, that seems to be the most popular way to do it. – yves03 – 2019-06-27T07:27:40.690

No answers