Cloud-Config - Hashed Password Being Set Incorrectly

I'm provisioning an Ubuntu 14.04 server with Digital Ocean and am using Cloud-Config in the user data field to do some initial setup. The issue I am having is creating a new user and setting a password with a SHA-512 hashed password string. Upon creation of the server, this new password does not work. When examining the /etc/shadow file, I find that the hashed password has been copied over with an erroneous ! at the start of the hash. Example line from /etc/shadow/ is as follows:

jerry:!$6$rHazYJBiLiJ2$yZei93AcU9JlauoBV338kVMAOBk0b83iYtxw2/seXfTVuW0e6qtP4sL.ip9JVdnT3HbZ4620ql66WaEANJkg61:16855:0:99999:7:::

Upon removing the ! immediately after jerry:, the password works as expected.

Does anyone have any idea why this could be happening?

2
задан 24 February 2016 в 08:02
1 ответ

После небольшого исследования тонкостей Cloud-Config я обнаружил проблему. По умолчанию для параметра lock-passwd установлено значение True. Это является причиной добавления ! перед хешированным паролем в / etc / shadow . Явная установка для lock-passwd значения False позволяет всему плавать плавно!

1
ответ дан 3 December 2019 в 12:42

Теги

Похожие вопросы