guysoft / CustomPiOS

A Raspberry Pi and other ARM devices distribution builder
GNU General Public License v3.0
514 stars 149 forks source link

Change default 'pi' password? #104

Closed grantemsley closed 3 years ago

grantemsley commented 3 years ago

Can the existing admintools module be used to change the password for the pi user? Or does that functionality already exist in one of the modules?

It looks like you have to specify a new user to be created if you want to set a password.

grantemsley commented 3 years ago

I haven't tested it, but I think if you changed the 'useradd' lines to continue on error it would let you specify ADMIN_TOOLKIT_NAME=pi and change the password and add SSH keys for the existing user.

Either that, or if you don't like ignoring potential errors, check if the account exists and skip creating it if it does.

I'm going to test this and make a pull request shortly.

guysoft commented 3 years ago

There is no functionality for that, it would need to be added. Probably in the base module. Currently it only sets the password if the user does not exist: https://github.com/guysoft/CustomPiOS/blob/devel/src/modules/base/start_chroot_script#L43