Jump to content

Go Script Not Fully Executing Script


Recommended Posts

I have my go script running a script to move some ssh files into place (authorized keys, known hosts, etc) but it doesn't seem to fully work.

 

 

Here is how it is called in my go (chmod is 777):

/boot/custom/ssh/ssh_prep.sh

 

here is the ssh_prep.sh:

mkdir ~/.ssh
cat /boot/custom/ssh/Wolverine_id_rsa.pub >> ~/.ssh/authorized_keys
cat /boot/custom/ssh/Chaos_id_rsa.pub >> ~/.ssh/authorized_keys
cp /boot/custom/ssh/Juggernaut_id_rsa.pub ~/.ssh/id_rsa.pub
cp /boot/custom/ssh/Juggernaut_id_rsa ~/.ssh/id_rsa
cp /boot/custom/ssh/Juggernaut_known_hosts ~/.ssh/known_hosts
cp /boot/custom/ssh/hosts.allow /etc/
cp /boot/custom/ssh/hosts.deny /etc/
chmod 644 /etc/hosts.allow
chmod 644 /etc/hosts.deny
chmod 700 ~/.ssh/authorized_keys
chmod 600 ~/.ssh/id_rsa*
chmod 600 ~/.ssh/known_hosts

 

 

The ~/.ssh directory is being created and the hosts.allow/deny files are being moved properly but not the id_rsa or the id_rsa.pub and the authorized_keys file doesn't seem to be created.

 

When I run the file manually it works just fine... any ideas? (new to bash scripts so go easy  :) )

 

 

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...