how do i edit the GO File for latest Unraid and SSH stuff


Recommended Posts

so  in the latest unraid and  Fix Common issues it doesnt like the old GO file... i click the "This"  to take me to a page about talking about the go file and ssh  but it made no sense..

it wasnt detailed for a dummy to understand

so i have 4 unraid servers.. but here is my "main server"  i remed things out thought it would help but i cant run rsync stuff now

what do  i edit what do i keep what do i toss

 

or what what do you change around

 

#!/bin/bash 
# Start the Management Utility
/usr/local/sbin/emhttp &
 
#CPU Mobo  Temperatures for AMD Ryzen
#modprobe nct6775 force_id=0xd120

# Copy SSH files back to /root/.ssh folder and set permissions for files
    #mkdir -p /root/.ssh
    #cp /boot/config/ssh/tower_root /root/.ssh/id_rsa
    ##cat /boot/config/ssh/*.pub >> /root/.ssh/authorized_keys
    ##cat /boot/config/ssh/mitchsserver_root.pub >> /root/.ssh/authorized_keys
    ##cat /boot/config/ssh/backupserver_root.pub >> /root/.ssh/authorized_keys
    ##cat /boot/config/ssh/mitchflix_root.pub >> /root/.ssh/authorized_keys
    ##cat /boot/config/ssh/pumppi_root.pub >> /root/.ssh/authorized_keys
#    ssh-keyscan mitchflix >> /root/.ssh/known_hosts     #MitchFlix At Home
#    ssh-keyscan 192.168.0.9 >> /root/.ssh/known_hosts   #MitchFlix At Home
#    ssh-keyscan 192.168.0.8 >> /root/.ssh/known_hosts   #Mitch Server At Home
#    ssh-keyscan 192.168.1.8 >> /root/.ssh/known_hosts   #Mitch Server
#    ssh-keyscan 192.168.1.9 >> /root/.ssh/known_hosts   #Mitch Flix
#    ssh-keyscan backupserver >> /root/.ssh/known_hosts  #Backupserver
#    ssh-keyscan 192.168.0.4 >> /root/.ssh/known_hosts   #Backupserver
#    ssh-keyscan 192.168.0.12 >> /root/.ssh/known_hosts  #Raspberry Pi
#    chmod g-rwx,o-rwx -R /root/.ssh

#!/bin/bash 
# Start the Management Utility
/usr/local/sbin/emhttp &
 
#CPU Mobo  Temperatures for AMD Ryzen
#modprobe nct6775 force_id=0xd120

# Copy SSH files back to /root/.ssh folder and set permissions for files
	#mkdir -p /root/.ssh
	#cp /boot/config/ssh/tower_root /root/.ssh/id_rsa
	##cat /boot/config/ssh/*.pub >> /root/.ssh/authorized_keys
	##cat /boot/config/ssh/mitchsserver_root.pub >> /root/.ssh/authorized_keys
	##cat /boot/config/ssh/backupserver_root.pub >> /root/.ssh/authorized_keys
	##cat /boot/config/ssh/mitchflix_root.pub >> /root/.ssh/authorized_keys
	##cat /boot/config/ssh/pumppi_root.pub >> /root/.ssh/authorized_keys
#	ssh-keyscan mitchflix >> /root/.ssh/known_hosts     #MitchFlix At Home
#	ssh-keyscan 192.168.0.9 >> /root/.ssh/known_hosts   #MitchFlix At Home
#	ssh-keyscan 192.168.0.8 >> /root/.ssh/known_hosts   #Mitch Server At Home
#	ssh-keyscan 192.168.1.8 >> /root/.ssh/known_hosts   #Mitch Server
#	ssh-keyscan 192.168.1.9 >> /root/.ssh/known_hosts   #Mitch Flix
#	ssh-keyscan backupserver >> /root/.ssh/known_hosts  #Backupserver
#	ssh-keyscan 192.168.0.4 >> /root/.ssh/known_hosts   #Backupserver
#	ssh-keyscan 192.168.0.12 >> /root/.ssh/known_hosts  #Raspberry Pi
#	chmod g-rwx,o-rwx -R /root/.ssh

 

Link to comment

ya i read that.. thats where the wasnt detailed enough for a dummy comes from

 

so how i understand that if i push the ssh keys on the usb   it automaticlly copies to the unraid boot up root

and automaticlly installs them  

but it doesnt cuz it doesnt work

 

do i need to keep the mkdir  the cp and the cat  and the chmod

 

 

to me   from that link to me  i only have to place the keys on the usb and it automatically sets it up. least thats how i understand it works

you copy to usb.. you reboot.. and it automacily copys into known_hosts

but its not doing that.. and i dont think it does that

as i still cant do my day rysncs across all 4 servers

 

 

 

Link to comment

ok so heres the confusion then.. do i need makey the keys and copy each time

 

all 4 servers have all key of the keys in there .ssh folder on there usbs  

all 4 servers import the keys in there go files above 

 

so do i need to do that each time  cat ~/.ssh.....

 

do i add to the go file

 

or do i do 

cat ~/.ssh/id_rsa.pub | ssh root@remote_host "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"

 

on the main server and import all the keys in one shot then reboot to solve the iss

 

 

as i thought once its on the usb  its done and i dont need any of those lines etc..

so do i add 

cat ~/.ssh/id_rsa.pub | ssh root@remote_host "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"

to the go file for each reboot

 

as i thought from the doc  as long as you copy the keys to the USB  in the .ssh    

unraid takes care of the rest

but it didnt work that way

Edited by comet424
Link to comment

so here is my Main Server  key s on the usb  access my 4 servers and a raspberry pi

i thought from the docs as long as i have them here.. i no longer need the ssh cat cp in the go file.

 

that unraid  copies the ssh folder to the unraid  and imports them thats what i though..  

so i already do it.. 

 

do i just run

cat ~/.ssh/id_rsa.pub | ssh root@remote_host "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"

 

that line once?  as all 4 usbs have all the keys.. and if thats once.. is that in the go file.. or  just at the command line

 

so they all look similar to the pic

unraidkey.PNG

Edited by comet424
Link to comment

so thats how i thought thats how the doc ment when i read it

since i have all the keys in there ssh folder

i no longer need the go file for the keys part

with the new version of unraid it reads that usb folder ssh and automaically imports and does what it has to 

 

that was what i was thinking and i wouldnt have to do anything else

because i read 

"

So, if you had previously added commands to your go script to copy authorized_keys and other files to /root/.ssh, you should remove those commands and simply put the files in config/ssh/root, then reboot.

Note: if you examine the sshd startup script /etc/rc.d/rc.sshd, upon boot all files from the config/ssh directory are copied to /etc/ssh (but not subdirs).  The purpose is to restore the host ssh keys; however, this mechanism can be used to define custom ssh_conf and sshd_conf files."

 

 

but it doesnt wanna rsync  between the servers

Edited by comet424
Link to comment

so technically  i already ran this

cat ~/.ssh/id_rsa.pub | ssh root@remote_host "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys

basiclly in 2018 2019

and the keys are on all each servers usb   

do i need to re run it.. i not at home to test it..  

so basiclly it takes the id_rsa.pub key thats generated copied to 1 of the other servers nd puts it into there autohrozied keys

but techanlly  all my servers are authorized  

 

hmmm  ill have to try when i get home  but i already got keys there   ill have to post the script log  when i get home

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.