0

After add expire: true in the cloud-init script, I can log in via key to the server, but it says You must change your password now and login again! I want if I set the password, the password expires after the first login and if I set a key, the system does not ask for the current password. Is there any solution?

This is my script

#cloud-config password: {$password} chpasswd: {literal}{expire: True}{/literal} ssh_pwauth: True ssh_authorized_keys: package_update: true package_upgrade: true

1 Answers1

0

Unrelated to cloud-init, if a user's password is expired, they cannot login over SSH, even with valid keys. There are, however, ways to work around this.

falcojr
  • 251
  • 1
  • 2