[SOLVED] Configuring SSH/ECDSA setup to support rsync between 2x v6 servers


Recommended Posts

I did't find anything on my issue in the wiki or posted earlier here, so here goes my question.

 

How can I stop rsync flagging an ECDSA key error, which seems to come back after every reboot, so is presumably related to the non-persistence of /

 

The error I'm seeing is something like (copied from a googled thread .. but with the specifics redacted by me):

 

The authenticity of host '[servername]:portnum ([nn.nn.nn.nn]:portnum)' can't be established.

ECDSA key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx.

Are you sure you want to continue connecting (yes/no)? yes

 

From what I've read elsewhere about ECDSA/SSH keys, they appear to be normally held in ~/ssh but in unRAID I gather they're  in /boot/config/ssh.

 

However, if they already exist in /boot/config/ssh, then why is rsync asking me for this info again, after every reboot.

What do I need to do to make this persistent so that when I later run my script from cron, it won't fail after each reboot.

 

Also given that after answering 'yes' to the above Q, rsync reports:

Warning: Permanently added '[servername]:portnum ([nn.nn.nn.nn]:portnum' (ECDSA) to the list of known hosts.

 

.... which clearly it isn't PERMANENTLY ADDED.

 

I'm running my script as root, if that makes a difference.

Source server is v6.1.3 and target is v6.2.0-beta21

 

Anyone have any advice/guidance on this config in unRAID ?

Thanks

Link to comment

I wanted to have an "authorized_keys" file in my ~/.ssh/ directory on every boot, but as this directory is not persistent, there is info about adding lines into your "go" script in another thread (don't ask which as I've read quite a few!).

 

Connect to the machine you want to be remembered and saying yes to the prompt will generate a "known_hosts" file in ~/.ssh

 

Copy the file into /boot/config/ssh dir so that there is a permanent copy on your USB key

 

Add the following lines to your "go" script (/boot/config/go)

 

# umask setup
umask 077

# Variable Setup
CONFIG=/boot/config/ssh
HOME_SSH=/root/.ssh

if [ ! -d "$HOME_SSH" ]; then
    mkdir $HOME_SSH
    cp $CONFIG/known_hosts $HOME_SSH
fi

 

 

If you need further clarification, just ask  :)

 

Binky

Link to comment

@binky:

That worked perfectly thanks. ECDSA/SSH key no longer being challenged following a reboot of my SOURCE c/w target server's name/IP noted in:

/boot/config/ssh/known_hosts

due to this being re-created (as /root/.ssh/known_hosts) by the syntax added to:

/boot/config/go

 

@ken-ji

Noted. Thanks

 

Solved!

Link to comment
  • 2 years later...

this is what I done

 

Initial Key making (one time  On Tower Main Server)

---------------------------------

    ssh-keygen -t rsa -b 2048 -f /root/.ssh/id_rsa
    cp /root/.ssh/* /boot/config/sshroot/

 

 

Main Server Go File

--------------------------

#Tower Server Copy SSH

#!/bin/bash
# Start the Management Utility
/usr/local/sbin/emhttp &
    mkdir -p /root/.ssh
    cp /boot/config/sshroot/* /root/.ssh/
    chmod g-rwx,o-rwx -R /root/.ssh

 

 

 

Then in windows I

-----------------------------------

copy \\tower\flash\config\sshroot   to    \\mitchsserver\flash\FromTower  

 

 

  

2nd Server Go file

------------------------------

#!/bin/bash
# Start the Management Utility
/usr/local/sbin/emhttp &

#Mitchs Server Copy SSH    
    mkdir -p /root/.ssh
    cp /boot/FromTower/sshroot/* /root/.ssh/
    cat /boot/FromTower/sshroot/id_rsa.pub > /root/.ssh/authorized_keys
    chmod g-rwx,o-rwx -R /root/.ssh

 

 

on mitchs server I type

rsync -avzu -s --stats --numeric-ids --progress -e "ssh -i /root/.ssh/id_rsa -T -o Compression=no -x"  root@tower:/mnt/user/Documents/ /mnt/user/Mikes\ Files/Documents/

 

so it does all this but still cant connect   I get the cant establish


 

Edited by comet424
  • Like 1
Link to comment

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.