From 0d9b952aeab95c59b28bcea42f719d06363b45b5 Mon Sep 17 00:00:00 2001 From: baude Date: Mon, 16 Sep 2019 10:48:34 -0500 Subject: support non-standard ssh port for remote-client when using the remote client, users may need to specify a non-standard port for ssh connections. we can do so on the command line and within the remote-client configuration file. Fixes: #3987 Signed-off-by: baude --- pkg/adapter/client_unix.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'pkg/adapter/client_unix.go') diff --git a/pkg/adapter/client_unix.go b/pkg/adapter/client_unix.go index 4781acd06..a7bc7c1c0 100644 --- a/pkg/adapter/client_unix.go +++ b/pkg/adapter/client_unix.go @@ -10,7 +10,11 @@ import ( ) func formatDefaultBridge(remoteConn *remoteclientconfig.RemoteConnection, logLevel string) string { + port := remoteConn.Port + if port == 0 { + port = 22 + } return fmt.Sprintf( - `ssh -T %s@%s -- /usr/bin/varlink -A \'/usr/bin/podman --log-level=%s varlink \\\$VARLINK_ADDRESS\' bridge`, - remoteConn.Username, remoteConn.Destination, logLevel) + `ssh -p %d -T %s@%s -- /usr/bin/varlink -A \'/usr/bin/podman --log-level=%s varlink \\\$VARLINK_ADDRESS\' bridge`, + port, remoteConn.Username, remoteConn.Destination, logLevel) } -- cgit v1.2.3-54-g00ecf