Skip to content

changed mdata-get and two initialization scripts#2

Open
MerlinDMC wants to merge 3 commits into
TritonDataCenter:masterfrom
MerlinDMC:mdata-get
Open

changed mdata-get and two initialization scripts#2
MerlinDMC wants to merge 3 commits into
TritonDataCenter:masterfrom
MerlinDMC:mdata-get

Conversation

@MerlinDMC
Copy link
Copy Markdown

mdata-get

mdata-get tries to read from the socket even if it is not available and runs in retries until canceled manually

# ./mdata-get dummy
./mdata-get: line 49: /dev/cuau1: No such file or directory
./mdata-get: line 60: 3: Bad file descriptor
mdata-get: timeout getting status. (exit code: 142)
./mdata-get: line 60: 3: Bad file descriptor
...

I've added code to check for socket presence before the read loop starts.

set-root-authorized-keys

If no metadata is set for root_authorized_keys a false .ssh/authorized_keys file is generated.
I've added code to test if the metadata could be read before generating folders and files.

run-user-script

If the user-script is not set in customer_metadata "No metadata for user-script" is saved in /root/user-script and left there.
I've just added code to remove the file in that single case.

@MerlinDMC
Copy link
Copy Markdown
Author

If someone has created a VM with the provided images for centos for example and forgot to add his pubkey in the metadata, changed the metadata and rebooted the VM he/she would not be able to log in because of the false authorized_keys already generated.

In that case it is enough to use VNC to login as root and delete the /root/.ssh folder and reboot again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant