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

Bug #1437350 reported by Attila Fazekas on 2015-03-27
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
CirrOS
Fix Released
Low
Scott Moser
cloud-init
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)
Attila Fazekas (afazekas) wrote :

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

Changed in cloud-init:
assignee: nobody → Dan Watkins (daniel-thewatkins)
status: New → In Progress
summary: - cirros uses exit status 0 when trying to login as root
+ Don't use exit status 0 when rejecting login as root
Dan Watkins (daniel-thewatkins) 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) on 2015-08-26
Changed in cirros:
importance: Undecided → Low
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
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
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers