diff options
| author | 2020-07-17 03:43:42 +0000 | |
|---|---|---|
| committer | 2020-07-17 03:43:42 +0000 | |
| commit | 6e617869135b0b096b66e86138fc9238b561ad71 (patch) | |
| tree | 325220d96c8f166118fd3ea1f36fe676e1addbe4 /usr.bin/ssh/sshconnect.c | |
| parent | Virtual functions are effectively identical to full physical functions, (diff) | |
| download | wireguard-openbsd-6e617869135b0b096b66e86138fc9238b561ad71.tar.xz wireguard-openbsd-6e617869135b0b096b66e86138fc9238b561ad71.zip | |
Add a '%k' TOKEN that expands to the effective HostKey of the
destination. This allows, eg, keeping host keys in individual files
using "UserKnownHostsFile ~/.ssh/known_hosts.d/%k".
bz#1654, ok djm@, jmc@ (man page bits)
Diffstat (limited to 'usr.bin/ssh/sshconnect.c')
| -rw-r--r-- | usr.bin/ssh/sshconnect.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/ssh/sshconnect.c b/usr.bin/ssh/sshconnect.c index a598c3a4cb4..3b17241794b 100644 --- a/usr.bin/ssh/sshconnect.c +++ b/usr.bin/ssh/sshconnect.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sshconnect.c,v 1.329 2020/03/13 04:01:56 djm Exp $ */ +/* $OpenBSD: sshconnect.c,v 1.330 2020/07/17 03:43:42 dtucker Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -77,11 +77,14 @@ expand_proxy_command(const char *proxy_command, const char *user, const char *host, const char *host_arg, int port) { char *tmp, *ret, strport[NI_MAXSERV]; + const char *keyalias = options.host_key_alias ? + options.host_key_alias : host_arg; snprintf(strport, sizeof strport, "%d", port); xasprintf(&tmp, "exec %s", proxy_command); ret = percent_expand(tmp, "h", host, + "k", keyalias, "n", host_arg, "p", strport, "r", options.user, |
