Workspace entries in SSH client config file inserted in incorrect location WITHIN an existing SSH host entry
What happened?
When creating a new DevPod workspace (using Kubernetes provider), a new record is added to the $HOME/.ssh/config file for the workspace connection. However, the new record is inserted in the middle of the first pre-existing SSH config record. This breaks the configuration of the pre-existing record. Example:
PRE-CHANGE STATE
Match Host a-sshd-hostname User ssh-username
Hostname a-sshd-hostname
User ssh-username
....
POST-CHANGE STATE
Match Host a-sshd-hostname User ssh-username
# DevPod Start test-8.devpod
Host test-8.devpod
ForwardAgent yes
LogLevel error
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
HostKeyAlgorithms rsa-sha2-256,rsa-sha2-512,ssh-rsa
ProxyCommand "C:\Program Files\DevPod\devpod-cli.exe" ssh --stdio --context default --user root test-8
User root
# DevPod End test-8.devpod
Hostname a-sshd-hostname
User ssh-username
....
What did you expect to happen instead?
Insert the new SSH connection configuration record either before or after all existing entries:
# DevPod Start test-8.devpod
Host test-8.devpod
ForwardAgent yes
LogLevel error
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
HostKeyAlgorithms rsa-sha2-256,rsa-sha2-512,ssh-rsa
ProxyCommand "C:\Program Files\DevPod\devpod-cli.exe" ssh --stdio --context default --user root test-8
User root
# DevPod End test-8.devpod
Match Host a-sshd-hostname User ssh-username
Hostname a-sshd-hostname
User ssh-username
....
OR
Match Host a-sshd-hostname User ssh-username
Hostname a-sshd-hostname
User ssh-username
....
# DevPod Start test-8.devpod
Host test-8.devpod
ForwardAgent yes
LogLevel error
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
HostKeyAlgorithms rsa-sha2-256,rsa-sha2-512,ssh-rsa
ProxyCommand "C:\Program Files\DevPod\devpod-cli.exe" ssh --stdio --context default --user root test-8
User root
# DevPod End test-8.devpod
How can we reproduce the bug? (as minimally and precisely as possible)
My devcontainer.json:
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/rust
{
"name": "Rust",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/rust:1-1-bullseye",
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
"settings": {},
"extensions": [
"streetsidesoftware.code-spell-checker"
]
}
}
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "rustc --version",
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
Local Environment:
- DevPod Version: v0.6.11
- Operating System: windows
- ARCH of the OS: AMD64
DevPod Provider:
- Kubernetes Provider: Client Version = v1.32.1; Kustomize Version = v5.5.0; Server Version: v1.32.1
Anything else we need to know?
Hey @zombiemaker, thanks for reporting this issue - we're going to take a look
Much appreciated. DevPod is a handy tool! Thanks for developing it!
On Tue, Feb 11, 2025 at 8:50 AM Pascal Breuninger @.***> wrote:
Hey @zombiemaker https://github.com/zombiemaker, thanks for reporting this issue - we're going to take a look
— Reply to this email directly, view it on GitHub https://github.com/loft-sh/devpod/issues/1635#issuecomment-2650885775, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACC6CV6WAMIB7T5CQU2UO232PH54BAVCNFSM6AAAAABW3H4PZSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNJQHA4DKNZXGU . You are receiving this because you were mentioned.Message ID: @.***> [image: pascalbreuninger]pascalbreuninger left a comment (loft-sh/devpod#1635) https://github.com/loft-sh/devpod/issues/1635#issuecomment-2650885775
Hey @zombiemaker https://github.com/zombiemaker, thanks for reporting this issue - we're going to take a look
— Reply to this email directly, view it on GitHub https://github.com/loft-sh/devpod/issues/1635#issuecomment-2650885775, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACC6CV6WAMIB7T5CQU2UO232PH54BAVCNFSM6AAAAABW3H4PZSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNJQHA4DKNZXGU . You are receiving this because you were mentioned.Message ID: @.***>
This issue is stale because it has been open for 60 days with no activity.
This issue was closed because it has been inactive for 30 days since being marked as stale.
I'm seeing this issue on Macos using local podman provider.