Skip to content

Shell "bash" is not executable: No such file or directory #119

@carlolars

Description

@carlolars

For some ssh-servers I need a Match host address exec "command" in my .ssh/config to run some command before doing the connection. From the ssh_config man page:

The exec keyword executes the specified command under the user's shell.

Unfortunately when wslgit starts bash inside wsl it use "bash" as the command, making the SHELL variable be set to just bash, which makes the execution fail with the error "Shell "bash" is not executable: No such file or directory".

The fix is to use /usr/bin/bash instead.

To test this, add the following to ~/.ssh/config:

Match host ssh-test exec "echo hello"

and then run the command wslgit clone git@ssh-test:repo.git and it will fail complaining about bash, when fixed it will instead fail with the error "ssh: Could not resolve hostname ssh-test: Name or service not known"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions