Site To Site SSH Key Gen Creator and Setup


Recommended Posts

i kinda mentioned before but be nice if Unraid had built in Option...  as i have issues its not taking  SSH Keys  to Rsync.. still need a a password to rsync even though other site has the pub keys etc

 

but it be nice in the Gui an option

 

Main Server : <key Name>
  rsa 2048
  
  1. Backupserver : 192.168.1.8     <password>
  2. Backupserver : 192.168.1.9     <password>
  3. Backupserver : 10.10.10.10     <password>
  50.....
  
  
  <cancel>    <Submit>
  
  
  

and what then it do it would Create   the Key Name   then it would connect  copy the keys to the approiate spot...  it would give whatever permissions  needed.. and tell ya if there is an error or if its constantly  going to keep saying  "password"  or  yes no fingerrprint

when you rysnc or wanna just    "ssh root@"192.168.1.9"  and not need a password

 

but like a 1 Click option be great

 

and then you can do it on your backup servers  same...   just enter above and then it would copy all the info to 3 backup servers

 

and it be in cremental to so if you had 50 unraids  you just do it .. and it would copy to all 50 unraids

 

so this way you cant makes a mistake by typo  or not a right Chmod etc.. all behind the scene

 

 

 

also another feature if it saved the info above it it could say  

 

  
  1. Backupserver : 192.168.1.8     <connected>
  2. Backupserver : 192.168.1.9     <diconnected>
  3. Backupserver : 10.10.10.10     <connected>
  4. Backupserver : 10.10.10.40     <unable to esstablish connection>

 

 

this would show  which sites are connected with the SSH   and which ones are offline or cant connect 

 

and it could try to connect to everyone  at boot up

Edited by comet424
Link to comment
8 minutes ago, comet424 said:

SSH Keys  to Rsync.. still need a a password to rsync even though other site has the pub keys etc

That suggests you created an SSH key with a password, if there's no password and it exists on both servers it won't ask for one.

 

https://phoenixnap.com/kb/setup-passwordless-ssh

 

Quote

3. It also asks you to set a passphrase. Although this makes the connection even more secure, it may interrupt when setting up automated processes. Therefore, you can type in a passphrase or just press Enter to skip this step.

 

Link to comment

oh and i did that passwordless setup  in my General Post  i showed my steps.. and the LuckyBackup Steps did not work.

it still asks for a password  or  yes/no/fingerprint  everytime  you run rsync with the key file

 

so thats why i posted a feature request... where it sets everything up without any mistakes..     all you have to do is fill in the fields  and press  Submit button and it does it all in the background

 

 

so the only  Password is  on "Root"   because damn Fix Common Issues says you need a Password..    but there is no  Password  on the SSH Key  only on  Root login

thats the password its asking for Root  not SSH Key

Link to comment

well thats why i said i looking for flawless

 

as you see in General support   i have issue with  Lucky Backup  asking  for a Password  or a Yes/No/Fingerprint

 

also Rysnc   will not work  here is copy from 

root@Tower:/mnt/user/Downloads# rsync -avz -e "ssh -i /root/.ssh/Main_Server" /mnt/user/Documents/Bell/ [email protected]:/mnt/user/downloads/Bell/
Password: 
sending incremental file list
created directory /mnt/user/downloads/Bell

 

 

so you still need to add Root Password....  or am i doing something wrong?  thopugh the   SSH keys was to bypass Root password
 

 

thats why i requesting a  Fool Proof   Key Generate and Copy to multiple servers flawless

 

Link to comment

and reason for the request

 

to do it flawless set it up  and have 0 mistakes... for anyone that isnt an experienced user

 

as you see i need a password even though the other computer has the Key

 

you need the Root Password on the Remote Site for it to rsync as you see above

 

Edited by comet424
Link to comment

and on my other server   i have the keys there and i get the finger print error

this is why i just looking for a Flawless   way to create it for anyone that isnt an advanced user..  just simply  fill in the fields

 

just like Filling in  Server name Field and Description Field.. and then you click Save and your done

 

i will recreate the entire process and paste it... since im not being believed what i see

luckyback4.PNG

luckybackup3.PNG

Edited by comet424
Link to comment
root@Tower:~# ssh-keygen -t rsa -b 2048 -f /root/.ssh/Main_Server
Generating public/private rsa key pair.
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/Main_Server
Your public key has been saved in /root/.ssh/Main_Server.pub
The key fingerprint is:
SHA256:PQIIf9bLJLNAua+QP22UCMwjGYJK9a0ZS+dZR2r9Cnc root@Tower
The key's randomart image is:
+---[RSA 2048]----+
|. o...     .     |
|+. +o...  +      |
|+=  +=*oo+ o     |
|+ = o+BB+o. .    |
| . + *.+S.o. E   |
|  o . +  .o.o    |
|   o +     .     |
|    + o          |
|     o           |
+----[SHA256]-----+
root@Tower:~# scp /root/.ssh/Main_Server.pub 192.168.1.9:/root/.ssh/
The authenticity of host '192.168.1.9 (192.168.1.9)' can't be established.
ECDSA key fingerprint is SHA256:oEGNuV3hDSqyFBqKN725eHCJfx9zND6Dv2deeI46v74.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.1.9' (ECDSA) to the list of known hosts.
Password: 
scp: /root/.ssh/: Is a directory
root@Tower:~# ssh [email protected]
Password: 
Last login: Fri Feb 25 10:04:21 2022 from 192.168.0.3
Linux 5.10.28-Unraid.
root@MitchFlix:~# mkdir /root/.ssh
root@MitchFlix:~# exit
logout
Connection to 192.168.1.9 closed.
root@Tower:~# scp /root/.ssh/Main_Server.pub 192.168.1.9:/root/.ssh/
Password: 
Main_Server.pub                                                                             100%  392     4.1KB/s   00:00    
root@Tower:~# ssh [email protected]
Password: 
Last login: Fri Feb 25 10:10:33 2022 from 192.168.0.3
Linux 5.10.28-Unraid.
root@MitchFlix:~# cat /root/.ssh/Main_Server.pub >> /root/.ssh/authorized_keys
root@MitchFlix:~# cd /root/.ssh
root@MitchFlix:~/.ssh# ls
Main_Server.pub  authorized_keys
root@MitchFlix:~/.ssh# exit
logout
Connection to 192.168.1.9 closed.
root@Tower:~# rsync -avz -e "ssh -i /root/.ssh/Main_Server" /mnt/user/Documents/Bell/ [email protected]:/mnt/user/downloads/Bell/
Password: 
sending incremental file list

sent 159 bytes  received 12 bytes  31.09 bytes/sec
total size is 23,958  speedup is 140.11
root@Tower:~# ^C
root@Tower:~# 

 

 

followed the unraid luckybackup blog  with a few changes 

 

to do exactly the luckybackup blog  this is what it is   minus 1 step they forget to tell you  you have to do... and you see you still need the Root Password for the 192.168.1.9 server..    and i just used the rysnc  command line  didnt load up luckybackup

 

 

still need Root Password of the Backupserver 192.168.1.9

 

root@Tower:~# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa
Your public key has been saved in /root/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:hV6EJr9XtRNZCWxKca27F5dV9o2H7+TjQ6a4FuboVS8 root@Tower
The key's randomart image is:
+---[RSA 3072]----+
|         ...ooooo|
|      . oo ..o+oo|
|       +. + o..*+|
|       ..o ...= =|
|        S. . ..+o|
|        . .o...=+|
|         .+.oE==o|
|         ..+ o.+o|
|        ..... o.o|
+----[SHA256]-----+
root@Tower:~# scp /root/.ssh/id_rsa.pub 192.168.1.9:/root/.ssh/
Password: 
scp: /root/.ssh/: Is a directory
root@Tower:~# ssh [email protected]
Password: 
Last login: Fri Feb 25 10:15:49 2022 from 192.168.0.3
Linux 5.10.28-Unraid.
root@MitchFlix:~# mkdir /root/.ssh
root@MitchFlix:~# exit
logout
Connection to 192.168.1.9 closed.
root@Tower:~# scp /root/.ssh/id_rsa.pub 192.168.1.9:/root/.ssh/
Password: 
id_rsa.pub                                                                                  100%  564    18.0KB/s   00:00    
root@Tower:~# ssh [email protected]
Password: 
Last login: Fri Feb 25 10:16:56 2022 from 192.168.0.3
Linux 5.10.28-Unraid.
root@MitchFlix:~# cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
root@MitchFlix:~# cd /root/.ssh
root@MitchFlix:~/.ssh# ls
authorized_keys  id_rsa.pub
root@MitchFlix:~/.ssh# exit
logout
Connection to 192.168.1.9 closed.
root@Tower:~# rsync -avz -e "ssh -i /root/.ssh/id_rsa" /mnt/user/Documents/Bell/ [email protected]:/mnt/user/downloads/Bell/Password: 
sending incremental file list

sent 159 bytes  received 12 bytes  31.09 bytes/sec
total size is 23,958  speedup is 140.11
root@Tower:~# ^C
root@Tower:~# 

 

 

 

this is why i requesting.. a Flawless   no way you can make a mistake.. and works 100% of the time.. as right now i must be doing something wrong.. as it shouldnt keep asking me for the 192.168.1.9  Root User Password..

Edited by comet424
Link to comment

so i tried to follow your link you sent 

only time it works is if you dont change  "ID_RSA"  you cant have it a new key file name

if you specify     Main_Server        instead of id_RSA    

it fails every time.. 

as i want  Pub Keys of each server 

so that website  also not fool proof

 

 

as i have 5  Unraid Servers and i want them all to talk together without passwords.. but i cant do ID_RSA for all of them  reason i wanted like

Mainserver.pub

Backupserver1.pub

Backupserver2.pub 

and so on.

 

i did that chmod  where it says you might have older ssh  program  but its not working

 

root@Tower:~# ssh-keygen -t rsa -b 4096
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): /root/.ssh/Main_Server                
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/Main_Server
Your public key has been saved in /root/.ssh/Main_Server.pub
The key fingerprint is:
SHA256:6plt4py2UehSjvsUU65EWAAkQrzqqIK6qDiMbzotjZ0 root@Tower
The key's randomart image is:
+---[RSA 4096]----+
|=oo....          |
|.o   o           |
|  . . . .        |
| .   . +         |
|.     * S        |
|.    * *         |
|*= .o B          |
|%oE  *o*.        |
|&O. .+X+.        |
+----[SHA256]-----+
root@Tower:~# ls -al ~/.ssh/id_*.pub
/bin/ls: cannot access '/root/.ssh/id_*.pub': No such file or directory
root@Tower:~# ls -al ~/.ssh/Main*.pub
-rw-r--r-- 1 root root 736 Feb 25 10:39 /root/.ssh/Main_Server.pub
root@Tower:~# ssh [email protected] mkdir -p .ssh
Password: 
root@Tower:~# cat .ssh/Main_Server.pub | ssh [email protected] 'cat >> .ssh/authorized_keys'
Password: 
root@Tower:~# ssh [email protected]
Password: 
Last login: Fri Feb 25 10:38:51 2022 from 192.168.0.3
Linux 5.10.28-Unraid.
root@MitchFlix:~# exit
logout
Connection to 192.168.1.9 closed.
root@Tower:~# ssh [email protected] "chmod 700 .ssh; chmod 640 .ssh/authorized_keys"
Password: 
root@Tower:~# ssh [email protected]
Password: 
Last login: Fri Feb 25 10:41:24 2022 from 192.168.0.3
Linux 5.10.28-Unraid.
root@MitchFlix:~# 
root@Tower:~# ssh-keygen -t rsa -b 4096 -C "[email protected]"
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): /root/.ssh/Main_Server
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/Main_Server
Your public key has been saved in /root/.ssh/Main_Server.pub
The key fingerprint is:
SHA256:S4U3HJDncwauuu8DUhUNZGN4S1biUgnq/d+3rSs0HRw [email protected]
The key's randomart image is:
+---[RSA 4096]----+
|      .+@Oo      |
|     ..=B=+.  E  |
|    . .=o==. . . |
|   . ....o+.o o  |
|    ... S. + . . |
|    . .o..  o .  |
|     . oo  . .   |
|      . .. .. .. |
|      .+o.. .o++.|
+----[SHA256]-----+
root@Tower:~# ls -al ~/.ssh/Main*.pub
-rw-r--r-- 1 root root 747 Feb 25 10:45 /root/.ssh/Main_Server.pub
root@Tower:~# ssh [email protected] mkdir -p .ssh
The authenticity of host '192.168.1.9 (192.168.1.9)' can't be established.
ECDSA key fingerprint is SHA256:oEGNuV3hDSqyFBqKN725eHCJfx9zND6Dv2deeI46v74.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.1.9' (ECDSA) to the list of known hosts.
Password: 
root@Tower:~# cat .ssh/Main_Server.pub | ssh [email protected] 'cat >> .ssh/authorized_keys'
Password: 
root@Tower:~# ssh [email protected]
Password: 
Last login: Fri Feb 25 10:42:51 2022 from 192.168.0.3
Linux 5.10.28-Unraid.
root@MitchFlix:~# exit
logout
Connection to 192.168.1.9 closed.
root@Tower:~# ssh [email protected] "chmod 700 .ssh; chmod 640 .ssh/authorized_keys"
Password: 
root@Tower:~# ssh [email protected]
Password: 
Last login: Fri Feb 25 10:48:02 2022 from 192.168.0.3
Linux 5.10.28-Unraid.
root@MitchFlix:~# ls /root/.ssh
authorized_keys
root@MitchFlix:~# 

 

 

here i did a few times you can see only   "ID_RSA" works  you cant give it a file name or it fails.

root@Tower:~# ssh-keygen -t rsa -b 4096 -C "[email protected]"
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa
Your public key has been saved in /root/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:kF6mLiVYTcpAjseB32kKPhZniy3qZe73CqsTHneXJV4 [email protected]
The key's randomart image is:
+---[RSA 4096]----+
| o+   .          |
|.+ + + .         |
|..+.+.+ o        |
|.o.=+. * E       |
|..Boo = S        |
| O.+ = +         |
|+ *+o o          |
|.o+ oo           |
|.o++..o.         |
+----[SHA256]-----+
root@Tower:~# ls -al ~/.ssh/id_*.pub
-rw-r--r-- 1 root root 747 Feb 25 10:51 /root/.ssh/id_rsa.pub
root@Tower:~# ssh [email protected] mkdir -p .ssh
The authenticity of host '192.168.1.9 (192.168.1.9)' can't be established.
ECDSA key fingerprint is SHA256:oEGNuV3hDSqyFBqKN725eHCJfx9zND6Dv2deeI46v74.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.1.9' (ECDSA) to the list of known hosts.
Password: 
root@Tower:~# cat .ssh/ida_rsa.pub | ssh [email protected] 'cat >> .ssh/authorized_keys'
cat: .ssh/ida_rsa.pub: No such file or directory
Password: 

root@Tower:~# cat .ssh/id_rsa.pub | ssh [email protected] 'cat >> .ssh/authorized_keys'
Password: 
root@Tower:~# ssh [email protected]
Last login: Fri Feb 25 10:48:36 2022 from 192.168.0.3
Linux 5.10.28-Unraid.
root@MitchFlix:~# rm -r /root/.ssh
root@MitchFlix:~# exit
logout
Connection to 192.168.1.9 closed.
root@Tower:~# rm -r /root/.ssh
root@Tower:~# ssh-keygen -t rsa -b 4096
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): ^X^C
root@Tower:~# ssh-keygen -t rsa -b 4096 -C "[email protected]"
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): /root/.ssh/Main_Server
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/Main_Server
Your public key has been saved in /root/.ssh/Main_Server.pub
The key fingerprint is:
SHA256:iDplzWgIBv2/Z93Fn7nRS2BRr4g4qyVV62xVzSG4VbA [email protected]
The key's randomart image is:
+---[RSA 4096]----+
|..          .oo+ |
|. .        . .+oo|
|.. .      . oE. +|
|.. ..= . o + o.. |
|  . *.+ S o o+.  |
|   =  .. = .. + .|
|  o   ..o.+. . ++|
|   .  .+o.. . .o+|
|      .o       o.|
+----[SHA256]-----+
root@Tower:~# ls /root/.ssh
Main_Server  Main_Server.pub
root@Tower:~# cat .ssh/Main_Server.pub | ssh [email protected] 'cat >> .ssh/authorized_keys'
The authenticity of host '192.168.1.9 (192.168.1.9)' can't be established.
ECDSA key fingerprint is SHA256:oEGNuV3hDSqyFBqKN725eHCJfx9zND6Dv2deeI46v74.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.1.9' (ECDSA) to the list of known hosts.
Password: 
bash: .ssh/authorized_keys: No such file or directory
root@Tower:~# ssh [email protected] mkdir -p .ssh
Password: 
root@Tower:~# cat .ssh/Main_Server.pub | ssh [email protected] 'cat >> .ssh/authorized_keys'
Password: 
root@Tower:~# ssh [email protected]
Password: 
Last login: Fri Feb 25 10:53:07 2022 from 192.168.0.3
Linux 5.10.28-Unraid.
root@MitchFlix:~# ls /root/.ssh
authorized_keys
root@MitchFlix:~# rm -r /root/.ssh
root@MitchFlix:~# exit
logout
Connection to 192.168.1.9 closed.
root@Tower:~# rm -r /root/.ssh
root@Tower:~# ssh-keygen -t rsa -b 4096 -C "[email protected]"
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa
Your public key has been saved in /root/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:ktKY0fM4SSkyMmB9wMTpF2kjx9qfw+i2eyPYYYLHd5Q [email protected]
The key's randomart image is:
+---[RSA 4096]----+
|..=o+ .          |
|o  * X .         |
|o + X B .        |
| o = X E         |
|  o = % S        |
| . + * O         |
|  . B o .        |
|   . = o         |
|    .o= .        |
+----[SHA256]-----+
root@Tower:~# ls /root/.ssh
id_rsa  id_rsa.pub
root@Tower:~# ssh [email protected] mkdir -p .ssh
The authenticity of host '192.168.1.9 (192.168.1.9)' can't be established.
ECDSA key fingerprint is SHA256:oEGNuV3hDSqyFBqKN725eHCJfx9zND6Dv2deeI46v74.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.1.9' (ECDSA) to the list of known hosts.
Password: 
root@Tower:~# cat .ssh/id_rsa.pub | ssh [email protected] 'cat >> .ssh/authorized_keys'
Password: 
root@Tower:~# ssh [email protected]
Last login: Fri Feb 25 10:56:25 2022 from 192.168.0.3
Linux 5.10.28-Unraid.
root@MitchFlix:~# ls /root/.ssh
authorized_keys
root@MitchFlix:~# 

 

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.