Bug 1833874

Summary: [rhel-8.3]using root user error should cause a non-zero exit code
Product: Red Hat Enterprise Linux 8 Reporter: Huijuan Zhao <huzhao>
Component: cloud-initAssignee: Eduardo Otubo <eterrell>
Status: CLOSED ERRATA QA Contact: Huijuan Zhao <huzhao>
Severity: low Docs Contact:
Priority: low    
Version: 8.3CC: akostadi, eterrell, huzhao, jgreguske, linl, ribarry, xiachen, yacao, yuxisun
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: cloud-init-19.4-8.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1615842 Environment:
Last Closed: 2020-11-04 02:40:44 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: 1615842    
Bug Blocks:    

Comment 9 Huijuan Zhao 2020-08-25 10:40:55 UTC
Tested with cloud-init-19.4-9.el8.noarch, the issue is gone, change the status to VERIFIED.

Test steps:
1. Check /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;exit 142" <public_key>
2. Login instance with root, exit status is not 0:
$ ssh root.103.84
Please login as the user "cloud-user" rather than the user "root".

Connection to 10.0.103.84 closed.
$ echo $?
142

Comment 10 Rick Barry 2020-08-27 14:03:22 UTC
*** Bug 1615842 has been marked as a duplicate of this bug. ***

Comment 13 errata-xmlrpc 2020-11-04 02:40:44 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: cloud-init security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:4650