diff --git a/sshuttle/runner.go b/sshuttle/runner.go index c629d8d..09a8e82 100644 --- a/sshuttle/runner.go +++ b/sshuttle/runner.go @@ -39,7 +39,8 @@ func (b Runner) Run(data environment.Config, dryRun bool, args ...string) error networksPath, cidrPath), - fmt.Sprintf(`sshuttle --ssh-cmd "ssh -o IdentitiesOnly=yes -i ${ssh_key_path}" -r ubuntu@"%s" "${cidrs}"`, + fmt.Sprintf(`sshuttle --ssh-cmd "ssh -o IdentitiesOnly=yes -i ${ssh_key_path}" -r %s@"%s" "${cidrs}"`, + data.OpsManager.SshUser, data.OpsManager.IP.String()), } diff --git a/sshuttle/runner_test.go b/sshuttle/runner_test.go index 968eb54..e5726d6 100644 --- a/sshuttle/runner_test.go +++ b/sshuttle/runner_test.go @@ -39,6 +39,7 @@ var _ = Describe("sshuttle runner", func() { url, _ := url.Parse("https://www.test-url.io") data = environment.Config{ OpsManager: environment.OpsManager{ + SshUser: "ssh_user", PrivateKey: "private-key-contents", IP: net.ParseIP("10.0.0.6"), URL: *url, @@ -68,7 +69,7 @@ var _ = Describe("sshuttle runner", func() { `trap 'rm -f ${ssh_key_path}' EXIT`, `chmod 0600 "${ssh_key_path}"`, `cidrs="$(OM_CLIENT_ID='client_id' OM_CLIENT_SECRET='client_secret' OM_USERNAME='username' OM_PASSWORD='password' om -t https://www.test-url.io -k curl -s -p /api/v0/staged/director/networks | jq -r .networks[].subnets[].cidr | xargs echo)"`, - `sshuttle --ssh-cmd "ssh -o IdentitiesOnly=yes -i ${ssh_key_path}" -r ubuntu@"10.0.0.6" "${cidrs}"`, + `sshuttle --ssh-cmd "ssh -o IdentitiesOnly=yes -i ${ssh_key_path}" -r ssh_user@"10.0.0.6" "${cidrs}"`, })) })