Closed etungsten closed 2 years ago
Push above addresses comments.
--skip-login
from getty
servicespassword-hash
is not specified in the admin container's host-container user-data.Push above fixes some lingering comments.
Push above adds documentation about the new password-hash
field in the README.
Push above adds a change to remove surrounding quotes if there are surrounding quotes around the config values:
[erikson@admin]$ cat /proc/cmdline
console="tty0" console="ttyS1,115200n8" ...
[erikson@admin]$ CONSOLES=()
[erikson@admin]$ for opt in $(cat /proc/cmdline) ; do
> optarg="$(expr "${opt}" : '[^=]*=\(.*\)' ||:)"
> optarg="${optarg%\"}"
> optarg="${optarg#\"}"
> case "${opt}" in
> console=*) CONSOLES+=("${optarg%,*}") ;;
> esac
> done
[erikson@admin]$ echo ${CONSOLES[@]}
tty0 ttyS1
Push above fixes an issue where user creation may fail when the host restarts and the user already exists.
Push above also redirects some useless warnings/errors to /dev/null
Push above prevents an jq
invocation from failing the script.
It also adds a change to make the admin container sleep forever if the host-container user-data is unset to prevent errors later on in the script that will make the container fail.
Issue number: N/A
Description of changes:
Testing done: With no admin user-data specified. I was able to connect to the admin container via a serial console connection to my EC2 instance.
sudo sheltie
works,apiclient
works. I can still SSH to the admin container.I then set up a new bottlerocket host with admin container user-data containing a password-hash for the console login for my custom user: Userdata:
Then trying to login via serial console:
Terms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.