diff --git a/src/ssh-generator/ssh-issue.c b/src/ssh-generator/ssh-issue.c index 178fdef341..889f8836d9 100644 --- a/src/ssh-generator/ssh-issue.c +++ b/src/ssh-generator/ssh-issue.c @@ -13,6 +13,7 @@ #include "main-func.h" #include "mkdir.h" #include "parse-argument.h" +#include "socket-util.h" #include "ssh-util.h" #include "string-util.h" #include "strv.h" @@ -84,9 +85,15 @@ static int verb_make_vsock(int argc, char *argv[], uintptr_t _data, void *_userd } else out = stdout; - fprintf(out, - "Try contacting this VM's SSH server via 'ssh vsock%%%u' from host.\n" - "\n", cid); + if (VSOCK_CID_IS_REGULAR(cid)) + fprintf(out, + "Try contacting this VM's SSH server via 'ssh vsock%%%u' from host.\n" + "\n", cid); + else + /* Even when hwdb reports VSOCK_ACCEPT_VMADDR_CID_ANY=1, do not print + * VMADDR_CID_ANY in the output. It will be rejected by systemd-ssh-proxy, + * because it is still not a valid destination CID. */ + fputs("This VM's SSH server is available over AF_VSOCK.\n\n", out); if (f) { if (fchmod(fileno(f), 0644) < 0)