-
Notifications
You must be signed in to change notification settings - Fork 764
pkg/hostagent: Use in-process SSH client on executing requirement scripts #4333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
pkg/hostagent: Use in-process SSH client on executing requirement scripts #4333
Conversation
|
This change aims to avoid error: |
6f82138 to
bfad23e
Compare
7ac972c to
19da4f8
Compare
75df537 to
11f5967
Compare
This error no longer occurs, but instead ssh connection is no longer possible in macOS+QEMU. 😞 |
776ff21 to
9e82e1a
Compare
f82a400 to
8f0d92e
Compare
8f0d92e to
ad1aad8
Compare
|
https://github.com/lima-vm/alpine-lima does not support |
ad1aad8 to
8f0b3eb
Compare
| sshConfig := &ssh.ClientConfig{ | ||
| User: user, | ||
| Auth: []ssh.AuthMethod{ssh.PublicKeys(signer)}, | ||
| HostKeyCallback: ssh.InsecureIgnoreHostKey(), // lgtm[go/insecure-hostkeycallback] |
Check failure
Code scanning / CodeQL
Use of insecure HostKeyCallback implementation
| sshConfig := &ssh.ClientConfig{ | ||
| User: user, | ||
| Auth: []ssh.AuthMethod{ssh.PublicKeys(signer)}, | ||
| HostKeyCallback: ssh.InsecureIgnoreHostKey(), // lgtm[go/insecure-hostkeycallback] |
Check failure
Code scanning / CodeQL
Use of insecure HostKeyCallback implementation
Check the SSH server in a way that complies with the SSH protocol using x/crypto/ssh. This change fixes lima-vm#4334 by falling back to usernet port forwarder on failing SSH connections over VSOCK. - pkg/networks/usernet: Rename entry point from `/extension/wait_port` to `/extension/wait_ssh_server` Because it changed to an SSH server-specific entry point. When a client accesses the old entry point, it fails and continues with falling back to the usernet forwarder. - pkg/sshutil: Add `WaitSSHReady()` WaitSSHReady waits until the SSH server is ready to accept connections. The dialContext function is used to create a connection to the SSH server. The addr, user, privateKeyPath parameter is used for ssh.ClientConn creation. The timeoutSeconds parameter specifies the maximum number of seconds to wait. Signed-off-by: Norio Nomura <[email protected]>
This change changes the SSH server keys that have been generated for each boot in guest OS to be generated by hostagent for each boot. This allows the hostagent to obtain the public key before booting, so that knownhosts can be used with an ssh connection. The code that uses `ssh.InsecureIgnoreHostKey()` in `x/crypto/ssh` is pointed out in CodeQL as `Use of insecure HostKeyCallback implementation (High)`, so it is an implementation to avoid this. Signed-off-by: Norio Nomura <[email protected]>
…ipts Use an in-process SSH client on executing requirement scripts other than starting an SSH ControlMaster process. To fall back to external SSH, add the `LIMA_EXTERNAL_SSH_REQUIREMENT` environment variable. - pkg/sshutil: Add `ExecuteScriptViaInProcessClient()` Signed-off-by: Norio Nomura <[email protected]> # Conflicts: # pkg/sshutil/sshutil.go # Conflicts: # pkg/sshutil/sshutil.go
Signed-off-by: Norio Nomura <[email protected]>
…cmdline `template:` refers to installed templates. So, it needs to be injected before executing `make install`. Signed-off-by: Norio Nomura <[email protected]>
…ForSSH()`" This reverts commit 5fde2e3. Signed-off-by: Norio Nomura <[email protected]>
Signed-off-by: Norio Nomura <[email protected]>
8047ecc to
0c13e06
Compare
Use an in-process SSH client on executing requirement scripts other than starting an SSH ControlMaster process. To fall back to external SSH, add the
LIMA_EXTERNAL_SSH_REQUIREMENTenvironment variable.ExecuteScriptViaInProcessClient()