RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1867170 - [cloud-init][rhel-8.3] User password lockout when the instance cache folder re-created
Summary: [cloud-init][rhel-8.3] User password lockout when the instance cache folder r...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: cloud-init
Version: 8.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: Eduardo Otubo
QA Contact: Huijuan Zhao
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-08-07 15:00 UTC by Huijuan Zhao
Modified: 2024-11-20 07:51 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-09-24 02:53:58 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Huijuan Zhao 2020-08-07 15:00:21 UTC
Description of problem: 
Create VM on openstack and set password for cloud-user, delete the instance cache folder /var/lib/cloud/instances/<id> in VM, reboot VM, the cloud-user's password is locked.

Version-Release number of selected component (if applicable):
cloud-init-19.4-7.el8.noarch

How reproducible:
100%

Steps to Reproduce:
1. Create a VM on openstack
2. Config password for user "cloud-user"
2.1 Set "ssh_pwauth:   1" in /etc/cloud/cloud.cfg
2.2 Set password for cloud-user:
#  passwd cloud-user
3. Reboot VM, check can login VM with "cloud-user/<password>"
4. Remove the instance cache folder
# rm -rf /var/lib/cloud/instances/<id>
5. Reboot VM
6. Try to login with "cloud-user" and <password>

 
Actual results:
After step 6, login VM failed: Permission denied, please try again.

Check the "cloud-user" <password> status:

# passwd -S cloud-user

cloud-user LK 2020-08-05 0 99999 7 -1 (Password locked.)

Expected results:
After step 6, login VM with "cloud-user/<password>" successful.

Additional info:
Also meet this issue on AWS VM.
The same issue on Azure is tracked by bug 1865715.

Comment 3 Eduardo Otubo 2020-09-21 12:54:13 UTC
(In reply to Huijuan Zhao from comment #0)
> Description of problem: 
> Create VM on openstack and set password for cloud-user, delete the instance
> cache folder /var/lib/cloud/instances/<id> in VM, reboot VM, the
> cloud-user's password is locked.
> 
> Version-Release number of selected component (if applicable):
> cloud-init-19.4-7.el8.noarch
> 
> How reproducible:
> 100%
> 
> Steps to Reproduce:
> 1. Create a VM on openstack
> 2. Config password for user "cloud-user"
> 2.1 Set "ssh_pwauth:   1" in /etc/cloud/cloud.cfg
> 2.2 Set password for cloud-user:
> #  passwd cloud-user
> 3. Reboot VM, check can login VM with "cloud-user/<password>"
> 4. Remove the instance cache folder
> # rm -rf /var/lib/cloud/instances/<id>
> 5. Reboot VM
> 6. Try to login with "cloud-user" and <password>
> 
>  
> Actual results:
> After step 6, login VM failed: Permission denied, please try again.
> 
> Check the "cloud-user" <password> status:
> 
> # passwd -S cloud-user
> 
> cloud-user LK 2020-08-05 0 99999 7 -1 (Password locked.)
> 
> Expected results:
> After step 6, login VM with "cloud-user/<password>" successful.
> 
> Additional info:
> Also meet this issue on AWS VM.
> The same issue on Azure is tracked by bug 1865715.

After some reading I got to some conclusions:
1) According to the documentation here[0], `ssh_pwauth' should contain values <yes/no/unchanged>
2) Manually deleting the iid with `rm -rf /var/lib/cloud/instances/<id>' is not really a scenario. It's almost like performing `manual_cache_clean' on the instance, but not telling cloud-init you actually did it. I suppose that if that happens we'll end up with a broken state where /var/lib/cloud/instance points to an instance-id which was manually deleted. Which is different from the Azure scenario linked by Rick - in this case the same DataSource (CDROM) would be used for other instances and before deploying them the password needs to be redacted.
3) You were trying to login via SSH, but tried to check the password status with `passwd' and terminal logins are locked by default with cloud-init.
4) I believe you can't login via SSH because you manually removed the instance folder and it probably got configured with default values, as before before step 1. (from your scenario)

If you agree we can close it as NOTABUG.

[0] https://cloudinit.readthedocs.io/en/latest/topics/modules.html#set-passwords


Note You need to log in before you can comment on or make changes to this bug.