I am trying to write a linode stackscript, which is a bash file which is run as root when you build a new image. It can prompt for parameters such as USER, KEY and possibly, but not ideally, PASSWORD.
In the script I create a user "bob", then
adduser --disabled-password --gecos "" --shell /bin/bash $USER
adduser $USER sudo
We are creating the user with certificate and with no password, the user, once logged in via SSH, cant sudo as it prompts for a password that doesnt exist.
I assume there are 2 options here:
- give it a password. Unfortunately, there is no option to do this via parameter, so is there a way to do it without prompts (not interactive)?
- fix it so bob doesn't need to enter a password.