Bug 1615842
| Summary: | using root user error should cause a non-zero exit code | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Aleksandar Kostadinov <akostadi> | |
| Component: | cloud-init | Assignee: | Virtualization Maintenance <virt-maint> | |
| Status: | CLOSED DUPLICATE | QA Contact: | Huijuan Zhao <huzhao> | |
| Severity: | unspecified | Docs Contact: | ||
| Priority: | low | |||
| Version: | 8.3 | CC: | akostadi, eterrell, huzhao, jgreguske, leiwang, linl, ribarry, xiachen, yacao, yuxisun | |
| Target Milestone: | rc | Flags: | pm-rhel:
mirror+
|
|
| Target Release: | 8.3 | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | Doc Type: | If docs needed, set a value | ||
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 1833874 (view as bug list) | Environment: | ||
| Last Closed: | 2020-08-27 14:03:22 UTC | Type: | Bug | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | --- | Target Upstream Version: | ||
| Embargoed: | ||||
| Bug Depends On: | ||||
| Bug Blocks: | 1833874 | |||
|
Description
Aleksandar Kostadinov
2018-08-14 11:32:29 UTC
I just tested that in 7.6 images (RHEL-7.6-20190103.n.3-Server-x86_64 ) it is still the same.
The issue is that in /root/.ssh/authorizer_keys there is:
> no-port-forwarding,no-agent-forwarding,no-X11-forwarding,command="echo 'Please login as the user \"cloud-user\" rather than the user \"root\".';echo;sleep 10" <public key>
At the end there should be something like `exit 1` so that it is clear to a script that something went wrong.
Tested with cloud-init-18.5-6.el7.x86_64 in rhel-7.8, the issue is still there, same as comment 0 and 6. This should be an easy to fix. Just add `exit 1` as last command in authorized_keys.
i.e. change /root/.ssh/authorized_keys to:
> no-port-forwarding,no-agent-forwarding,no-X11-forwarding,command="echo 'Please login as the user \"cloud-user\" rather than the user \"root\".';echo;sleep 10; exit 1" ssh-rsa AA..whatever-private-key....
This worked for me on RHEL 7.6.
Can't such a simple and straightforward fix be applied to 7.x?
Submitted upstream pull request... unless I am mistaken where upstream is. https://github.com/canonical/cloud-init/pull/469 (In reply to Aleksandar Kostadinov from comment #11) > Submitted upstream pull request... unless I am mistaken where upstream is. > > https://github.com/canonical/cloud-init/pull/469 Hi Aleksandar, I see your PR didn't get through because of CLA. I created a new PR since I've already signed it. Should be quick, once it lands I'll backport it. Also added your name for credit as original author: https://github.com/canonical/cloud-init/pull/472 Quick update: The PR was approved and will be merged soon. |