Public key authentication (rsync related)

Raspberry Pi related support

Public key authentication (rsync related)

Postby makfredo » 24 Sep 2017, 13:57

Hi everyone,
I've been trying to backup my library via rsync in Openmediavault running on another Raspberry Pi. I want to be able to sync the library to OMV on demand.
I've set a rsync task in OMV so that data is pulled from my Rune library, but for some reason login/password authentication doesn't work. The only other solution I have is public key authentication.
I've generated a key on the RasPi running OMV and transferred the public key to the RasPi running Rune, but it doesn't seem to do what it is expected, as I'm still asked for a password when I ssh into that machine.
Is there an authorized_keys file in RuneOS? What am I doing wrong?
I'm sure some wizard around here has the solution for what I want to do. Anyone?
makfredo
 
Posts: 14
Joined: 08 Aug 2015, 16:38

Re: Public key authentication (rsync related)

Postby makfredo » 26 Sep 2017, 08:00

Nevermind, I was not seeing things straight. Got everything working this morning!
I generated a SSH key in OMV, copied the public key to the clipboard and pasted it in home/.ssh/authorized_keys.
And BAM! Rsync is backing up my library right now.
makfredo
 
Posts: 14
Joined: 08 Aug 2015, 16:38

Re: Public key authentication (rsync related)

Postby colins » 27 Jun 2018, 23:20

Some other thoughts on getting rsync or putty to auto log in via ssh.
In V0.3 I found that putting my public keys in a file called authorized_keys in /root/.ssh worked just fine. I did not find that doing this in /home, as makfredo suggested, was effective.
It's best to set ACLs right too.
Code: Select all
cd /root
mkdir .ssh
chmod 700 .ssh
cd .ssh
touch authorized_keys
chmod 644 authorized_keys
nano authorized_keys

Then paste your public keys from the accessing system into authorized_keys and save. Typically they will be in the accessing system's user folder in .ssh in files like id_rsa.pub or id_dsa.pub.
DO NOT PUT YOUR PRIVATE KEYS HERE. THEY ARE LIKE id.rsa OR id.dsa AND SHOULD NEVER BE SHARED OR COPIED UNLESS YOU REALLY KNOW WHAT YOU'RE DOING.
colins
 
Posts: 6
Joined: 21 Jun 2018, 21:01

support RuneAudio Donate with PayPal


Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 1 guest