Jump to content

Example of a /boot/config/go file calling custom scripts?


tmchow

Recommended Posts

I'd like to see an example of a /boot/config/go file calling into custom scripts so I know the calling syntax to make sure I'm doing it right. (I'm trying to call a custom script to setup my SSH keys which keep getting blown away after reboot).

 

I've tried searching but oddly can't seem to find obvious example. Thanks!

Link to comment

If your ssh keys are deleted when you boot, you have a problem. They should be saved in /boot/config/ssh.

You might want to check your USB for corruption.

Add the diagnostics so we can see what is going on.

 

They weren't stores in /boot anywhere originally.

 

The issue is I want to have my /root/.ssh/authorized_keys file set every time on reboot so I can ssh in without a Pwd at home.

 

My plan was to put the file in /boot/config/ssh/ and make a go file script to copy it to /root/.ssh/.

 

 

Sent from my iPhone using Tapatalk

Link to comment

If your ssh keys are deleted when you boot, you have a problem. They should be saved in /boot/config/ssh.

You might want to check your USB for corruption.

Add the diagnostics so we can see what is going on.

 

They were stores in /boot anywhere.

 

The issue is I want to have my /root/.ssh/authorized_keys file set every time on reboot so I can ssh in without a Pwd at home.

 

My plan was to put the file in /boot/config/ssh/ and make a go file script to copy it to /root/.ssh/.

 

 

Sent from my iPhone using Tapatalk

Then you just make a folder on the flash drive, then add a command to the go file to copy the keys to the folder you need and that's it.

The go file is just a bash script file, so you just add the commands you use on the command line to the go script.

Link to comment

It'll be a lot easier to just do this:

# edit /boot/config/ssh/sshd_config

Look for AuthorizedKeysFile

change it to be like:

AuthorizedKeysFile    /etc/ssh/%u.pubkeys

# Save your public keys as

/etc/ssh/root.pubkeys (and)

/boot/config/ssh/root.pubkeys

 

That will take care of the problem once you have rebooted or restarted the SSH service with

/etc/rc.d/rc.sshd restart

 

of course if you need to install private keys, you could also edit /etc/ssh/ssh_config

Host *
  IdentityFile /etc/ssh/root.key

and save the private keys to:

/etc/ssh/root.keys (and)

/boot/config/ssh/root.keys

 

Link to comment

It'll be a lot easier to just do this:

# edit /boot/config/ssh/sshd_config

Look for AuthorizedKeysFile

change it to be like:

AuthorizedKeysFile    /etc/ssh/%u.pubkeys

# Save your public keys as

/etc/ssh/root.pubkeys (and)

/boot/config/ssh/root.pubkeys

 

That will take care of the problem once you have rebooted or restarted the SSH service with

/etc/rc.d/rc.sshd restart

 

of course if you need to install private keys, you could also edit /etc/ssh/ssh_config

Host *
  IdentityFile /etc/ssh/root.key

and save the private keys to:

/etc/ssh/root.keys (and)

/boot/config/ssh/root.keys

 

Is the /boot/config/ssh/sshd_config file supposed to already exist? I don't have that file anywhere.

Link to comment

Oops. I've had the customizations since 6.0b14...

 

if its not there get the original copy from /etc/ssh/ssh_config

When sshd starts up, the files in /boot/config/ssh gets copied over to /etc/ssh

so files in /boot/config/ssh override the stock versions in /etc/ssh

 

Link to comment

Archived

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

×
×
  • Create New...