Don't use exit status 0 when rejecting login as root

Bug #1437350 reported by Attila Fazekas
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
CirrOS
Fix Released
Low
Scott Moser
cloud-init
Won't Fix
Undecided
Dan Watkins

Bug Description

$ ssh -i mykey root@10.1.0.2 ls
Warning: Permanently added '10.1.0.2' (RSA) to the list of known hosts.
Please login as 'cirros' user, not as root

$ echo $?
0

Since the command is not executed the exit status should be non 0.

/root/.ssh/authorized_keys:
command="echo Please login as \'cirros\' user, not as root; echo; sleep 10" this part should be changed to:
"echo Please login as \'cirros\' user, not as root; echo; sleep 10; exit 1"

Related branches

Changed in cirros:
status: New → In Progress
assignee: nobody → Dr. Jens Rosenboom (j-rosenboom-j)
Revision history for this message
Attila Fazekas (afazekas) wrote :

Adding cloud-init as affacted project, because it also behavaes in this way.

Dan Watkins (oddbloke)
Changed in cloud-init:
assignee: nobody → Dan Watkins (daniel-thewatkins)
status: New → In Progress
Dan Watkins (oddbloke)
summary: - cirros uses exit status 0 when trying to login as root
+ Don't use exit status 0 when rejecting login as root
Revision history for this message
Dan Watkins (oddbloke) wrote :

Won't fix in cloud-init because we don't want to break backwards compatibility.

Changed in cloud-init:
status: In Progress → Invalid
status: Invalid → Opinion
status: Opinion → Invalid
Scott Moser (smoser)
Changed in cirros:
importance: Undecided → Low
Revision history for this message
Scott Moser (smoser) wrote :

fixed in master at e6d30c4d8b5a0903d900e9a00f9bc185ab25626c

Changed in cloud-init:
status: Invalid → Won't Fix
Changed in cirros:
assignee: Dr. Jens Rosenboom (j-rosenboom-j) → Scott Moser (smoser)
status: In Progress → Fix Committed
Revision history for this message
Dr. Jens Harbott (j-harbott) wrote :

This should be fixed in 0.4.0, please re-open if you still see an issue there. Exit code is 43.

Changed in cirros:
status: Fix Committed → Fix Released
Revision history for this message
James Falcon (falcojr) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.