When SSH exec's `step ssh check-host ...` under the hood, it only accepts the host's full FQDN as a valid input.
$ step ssh check-host 1234 ; echo $? 1 $ step ssh check-host 1234.box.hosts.smallstep.com ; echo $? 0
If you want to shorten these FQDNs, you can use the `CanonicalizeHostname` and `CanonicalDomains` options in your ssh_config settings. For example, the following configuration would allow users to SSH directly to box 1234.box.hosts.smallstep.com by only typing `ssh 1234`":
##### Contents of .ssh/config ##### # autogenerated by step @ 2022-05-19T22:02:11Z Host * CanonicalizeHostname yes CanonicalDomains box.hosts.smallstep.com Include "/home/<user>/.step/ssh/config" PreferredAuthentications publickey,password # end
SSHing to host 1234 will then succeed:
$ ssh 1234 -vvv debug1: Reading configuration data /home/<user>/.step/ssh/config debug2: checking match for 'exec "step ssh check-host %h"' host 1234.box.hosts.smallstep.com originally 1234 debug1: Executing command: 'step ssh check-host 1234.box.hosts.smallstep.com' debug3: command returned status 0 debug3: /home/<user>/.step/ssh/config line 1: matched 'exec "step ssh check-host 1234.box.hosts.smallstep.com"' debug2: match found debug1: Reading configuration data /etc/ssh/ssh_config