connect to NAS via sshfs/ using NAS with SSH keys

Raspberry Pi related support

connect to NAS via sshfs/ using NAS with SSH keys

Postby CH23 » 22 Mar 2017, 11:36

Hi all,

i'm having trouble configuring RuneAudio to work with my NAS.

the NAS can only be accessed via SSH, using SSH keys.

what i did so far:
I created a user
I added the .ssh directory as i had it on raspbian to the home directory of this user
I added an FSTAB entry for the NAS
Code: Select all
USER@LOCALIP:/volume1/music /mnt/MPD/LocalStorage/music fuse.sshfs defaults,port=8383,delay_connect,allow_other,transform_symlinks,follow_symlinks,identityfile=/home/USER/.ssh/id_rsa,_netdev,users 0 0


I created a directory 'music' in /mnt/MPD/LocalStorage
and chown'd it:
Code: Select all
sudo chown mpd:audio music


rebooted

now when i check the frontend of runeaudio, it shows 'local storage (1)', but nothing is in there.
when i do an ls -lah of /mnt/MPD/LocalStorage, i get the following:
Code: Select all
[root@runeaudio LocalStorage]# ls -lah
ls: cannot access 'music': Input/output error
total 8.0K
drwxr-xr-x 3 mpd audio 4.0K Mar 22 11:14 .
drwxr-xr-x 7 mpd audio 4.0K Mar 14  2016 ..
d????????? ? ?   ?        ?            ? music


I tried searching the forum, but found nothing.

raspberry pi 2b, running RuneAudio_rpi2_rp3_0.4-beta_20160321_2GB

-CH23
CH23
 
Posts: 9
Joined: 22 Mar 2017, 11:02

Re: connect to NAS via sshfs/ using NAS with SSH keys

Postby hondagx35 » 22 Mar 2017, 11:56

Hi,

the NAS can only be accessed via SSH, using SSH keys.

Why?

All NAS systems i know allow cifs or smb access.

Frank
User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: connect to NAS via sshfs/ using NAS with SSH keys

Postby CH23 » 22 Mar 2017, 12:05

hondagx35 wrote:Hi,

the NAS can only be accessed via SSH, using SSH keys.

Why?

All NAS systems i know allow cifs or smb access.

Frank


because unlike SMB/CIFS, SSH is secure.

my NAS is also web-facing, so security is quite important.
CH23
 
Posts: 9
Joined: 22 Mar 2017, 11:02

Re: connect to NAS via sshfs/ using NAS with SSH keys

Postby CH23 » 22 Mar 2017, 13:24

small update: I got it to work manually (not yet in FSTAB):
first you need to create a directory in/mnt/MPD/USB/ (or in NAS, LocalStorage, etc.) to whatever you want to mount it to. in my case 'music'.

Code: Select all
sshfs -p PORT USER@IPADDRESS:/ /mnt/MPD/USB/music -o identityfile=/home/USER/.ssh/id_rsa -o allow_other


the allow_other option seems vitally important.

PORT = port number you ssh to (only if not default)
USER@IPADDRESS = user and ip address of the NAS you connect to
USER(2) = local user (could probably put the /.ssh directory in /root/* )


-CH23
CH23
 
Posts: 9
Joined: 22 Mar 2017, 11:02

Re: connect to NAS via sshfs/ using NAS with SSH keys

Postby CH23 » 22 Mar 2017, 15:39

USER@IPADDRESS:/volume1/music/ /mnt/MPD/NAS/music fuse.sshfs defaults,port=PORT,delay_connect,allow_other,transform_symlinks,follow_symlinks,identityfile=/home/USER/.ssh/id_rsa,_netdev,users 0 0


this now works.
CH23
 
Posts: 9
Joined: 22 Mar 2017, 11:02

Re: connect to NAS via sshfs/ using NAS with SSH keys

Postby hondagx35 » 22 Mar 2017, 21:25

Hi CH23,

my NAS is also web-facing, so security is quite important.

OK, got it.

BTW: thank you for sharing this.

Frank
User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: connect to NAS via sshfs/ using NAS with SSH keys

Postby CH23 » 23 Mar 2017, 11:06

hondagx35 wrote:Hi CH23,

my NAS is also web-facing, so security is quite important.

OK, got it.

BTW: thank you for sharing this.

Frank


of course! the OS you guys have created is fantastic. the FOSS and Linux community helps me a lot, so I know that sharing info keeps it going!
CH23
 
Posts: 9
Joined: 22 Mar 2017, 11:02

support RuneAudio Donate with PayPal


Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 13 guests