Skip to content
This repository was archived by the owner on Oct 11, 2025. It is now read-only.

Commit 0644432

Browse files
author
Micah Young
committed
Change installer authorized_keys message to allow BOSH_ALL_PROXY
1 parent f19671f commit 0644432

File tree

1 file changed

+6
-5
lines changed
  • src/bosh-vmrun-cpi/cmd/installer

1 file changed

+6
-5
lines changed

src/bosh-vmrun-cpi/cmd/installer/main.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,19 +147,20 @@ func sshClient(sshHostname, sshPort, sshUsername, sshPrivateKey string) (client
147147
}
148148

149149
func sshAuthKeyMissingMessage(cpiDestPath, sshUsername, sshPublicKey string) (output string) {
150-
authKeyEntry := fmt.Sprintf(`restrict,command="%s ${SSH_ORIGINAL_COMMAND#* }" %s`, cpiDestPath, sshPublicKey)
151-
152150
tmpl := template.Must(template.New("tmpl").Parse(`
153151
CPI: ssh connection failed. Command not set correctly in authorized_key:
154152
155-
--------------------------
156153
add to your ~/.ssh/authorized_keys:
157-
{{.AuthKeyEntry}}
154+
--------------------------
155+
restrict,command="{{.CPIDestPath}} ${SSH_ORIGINAL_COMMAND#* }",port-forwarding,permitopen="*:6868",permitopen="*:25555" {{.SSHPublicKey}}
158156
--------------------------
159157
`))
160158

161159
var messageBuf bytes.Buffer
162-
_ = tmpl.Execute(&messageBuf, struct{ AuthKeyEntry string }{AuthKeyEntry: authKeyEntry})
160+
_ = tmpl.Execute(&messageBuf, struct {
161+
CPIDestPath string
162+
SSHPublicKey string
163+
}{cpiDestPath, sshPublicKey})
163164
return strings.TrimSpace(messageBuf.String())
164165
}
165166

0 commit comments

Comments
 (0)