ssh-keyscan does not exit with non-zero return code on error
Bug #1661745 reported by
Luke Browning
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
portable OpenSSH |
Unknown
|
Unknown
|
|||
openssh (Debian) |
Fix Released
|
Unknown
|
|||
openssh (Ubuntu) |
Fix Released
|
Low
|
Unassigned |
Bug Description
On xenial, ssh-keyscan returns zero indicating success, when the command fails.
root@cp1:~# lsb_release -d
Description: Ubuntu 16.04.1 LTS
root@cp1:~# ssh-keyscan -H -t ssh-rsa bad-host
getaddrinfo bad-host: Name or service not known
root@cp1:~# echo $?
0
On trusty, the exit status is non-zero as expected.
root@integratio
Description: Ubuntu 14.04.5 LTS
root@integratio
getaddrinfo bad-host: Name or service not known
root@integratio
255
This is a incompatibility between Ubuntu 14.04 and 16.04
Changed in openssh (Debian): | |
status: | Unknown → New |
Changed in openssh (Debian): | |
status: | New → Confirmed |
Changed in openssh (Debian): | |
status: | Confirmed → Fix Released |
To post a comment you must log in.
Hi,
I'm not sure ssh-keyscan was ever defined to have bad RC in that case.
The man page is empty, and the bit that I found online says:
RC=0
No usage errors. ssh-keyscan might or might not have succeeded or failed to scan one, more or all of the given hosts.
RC=1
Usage error.
Yes it changed in between Trusty and Xenial but that I think is just an upstream change.