Jump to content
We're Hiring! Full Stack Developer ×

unRAID v6.2.4 - persisting SSH keys


coliny

Recommended Posts

Hi, I searched, but couldn't find an answer to these questions:

- are unRAID's SSH keys persisted across reboots and unRAID upgrades?

- is unRAID's authorised_hosts persisted across reboots and unRAID upgrades?

 

Essentially I use unRAID to rsync out to clients so I add unRAID's public key to the client's authorized-hosts. Likewise, I SSH into unRAID a far bit and copy my public key to unRAID's authorized-users and I want to ensure this will persist across reboots and upgrades.

 

Any suggestions?

 

Thanks!

Link to comment

Hi, I searched, but couldn't find an answer to these questions:

- are unRAID's SSH keys persisted across reboots and unRAID upgrades?

- is unRAID's authorised_hosts persisted across reboots and unRAID upgrades?

 

Essentially I use unRAID to rsync out to clients so I add unRAID's public key to the client's authorized-hosts. Likewise, I SSH into unRAID a far bit and copy my public key to unRAID's authorized-users and I want to ensure this will persist across reboots and upgrades.

 

Any suggestions?

 

Thanks!

they should be.  They are normally stored on the flash in the config/ssh folder and restored to their correct runtime location any time unRAID boots.
Link to comment

Actually, it is a little more complicated because ssh really doesn't work well unless the keys are user read/write only. Unfortunately, extFat or Fat32 (I forget which) doesn't allow you to change them, so some hoops need to be jumped through.

 

(self promotion) I hastily blogged about it at https://colinyates.co.uk/posts-output/2016-12-08-unraid-and-ssh-keys/. Upgrades and clarifications welcome.

Link to comment

Try this:

http://lime-technology.com/forum/index.php?topic=52890.msg508295#msg508295

 

Edit: Oops, you also needed to keep your private keys persistent.

A usable solution is to make a custom package for private keys

 

# mkdir /boot/extra
# mkdir /tmp/package-keys
# cd /tmp/package-keys
# mkdir root/.ssh
# chmod 700 -r root
# cp private.key root/.ssh/id_rsa
# chmod 600 root/.ssh/id_rsa
# mkpkg -c n -l y /boot/extra/sshmasterkey-0.1-noarch-1.txz
# installpkg /boot/extra/sshmasterkey-0.1-noarch-1.txz

 

the resulting archive is a valid slackware package that contains your masterkey and placing it inside /bootextra will auto install everytime unraid starts up

the /tmp/package-keys dir can be deleted afterwards.

 

Link to comment
  • 3 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...