Giter VIP home page Giter VIP logo

devpod-provider-ssh's Introduction

DevPod SSH Provider

Join us on Slack! Open in DevPod!

This repository hosts the default SSH provider configuration used in DevPod.

Usage

To add this SSH provider from the CLI, use the provider add command. For example:

devpod provider add ssh

Compatibility

We only support Linux machine as remote hosts.

Windows

There are known issues with the default windows SSH installation in some setups. If you're unable to connect to your host by default, try to enable the USE_BUILTIN_SSH option

devpod provider add ssh --option USE_BUILTIN_SSH=true
# or if already installed
devpod provider set-options ssh --option USE_BUILTIN_SSH=true

This forces the provider to use the builtin SSH client over the one accessible in your shell. You will need to add the identities file manually to your SSH config in case it's not the default key:

Host my-domain.com
    User my-user 
    IdentityFile ~/.my-dir/my-key

Options

This provider has the following options:

NAME REQUIRED DESCRIPTION DEFAULT
HOST true The SSH Host to connect to. Example: [email protected]
AGENT_PATH false The path where to inject the DevPod agent to. /tmp/devpod/agent
DOCKER_PATH false The path of the docker binary. docker
EXTRA_FLAGS false Extra flags to pass to the SSH command.
PORT false The SSH port to use. 22
USE_BUILTIN_SSH false Use the builtin SSH package. false

Extra

For more detail, see the DevPod Documentation.

devpod-provider-ssh's People

Contributors

89luca89 avatar dependabot[bot] avatar fabiankramm avatar inhumantsar avatar pascalbreuninger avatar thomask33 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

devpod-provider-ssh's Issues

`EXTRA_FLAGS` option is ineffective

EXTRA_FLAGS is not read here, thus the option is ineffective at the moment:

func FromEnv() (*Options, error) {
retOptions := &Options{}
var err error
retOptions.DockerPath, err = fromEnvOrError(DOCKER_PATH)
if err != nil {
return nil, err
}
retOptions.AgentPath, err = fromEnvOrError(AGENT_PATH)
if err != nil {
return nil, err
}
retOptions.Host, err = fromEnvOrError(HOST)
if err != nil {
return nil, err
}
retOptions.Port, err = fromEnvOrError(PORT)
if err != nil {
return nil, err
}
return retOptions, nil
}

This also looks like dead code:

func ConfigFromEnv() (Options, error) {
return Options{
DockerPath: os.Getenv(DOCKER_PATH),
AgentPath: os.Getenv(AGENT_PATH),
Host: os.Getenv(HOST),
Port: os.Getenv(PORT),
ExtraFlags: os.Getenv(EXTRA_FLAGS),
}, nil
}

Provider not working with a custom port

Since v0.0.13, when you want to add a ssh provider with a custom port, this error appears:

image

This doesn't happen in v0.0.12

I suspect that it has to do with ssh -G [host] that was done in the new version of provider

(I was still very happy with the release of v0.0.13 since it fixed a bug in windows openSSH. This should fix loft-sh/devpod#1031)

ssh certificate authentication doesnt work on windows

Devpod: 0.5.16
ssh-provider: 0.0.14

I am trying to setup the ssh provider with a server that only allows login with ssh certificates.
It allways fails but the ssh command output in the debug output works fine.
The same works fine on a linux machine with the same devpod + ssh provider version.

I asume this is because that go based ssh client workaround only supports publickey authentication.
Any plans on extending that?

Spliting of extra flags is too naive

Splitting by spaces will not work in many cases

result = append(result, strings.Split(provider.Config.ExtraFlags, " ")...)

Here's an example with a ProxyCommand that would break:

EXTRA_FLAGS='-i~/.ssh/google_compute_engine -oProxyCommand="gcloud compute start-iap-tunnel %h %p --listen-on-stdin --project=<project> --zone=<region> --verbosity=warning"'

There are libraries out there that do "shell-like" splitting, I have not done the research to figure which one is best.

Extra note: the reproduction command in the error message is missing a space after ssh, it should be "ssh ":

return fmt.Errorf(sshError + "ssh" + strings.Join(getSSHCommand(provider), " ") + " " + command)

Non-default port in .ssh/config

I have an SSH server that is (only) in my ~/.ssh/config, like this:

Host myserver
  HostName 10.20.30.40
  Port 10022
  User myuser

So a non-default port, and a hostname that does not actually resolve via DNS or /etc/hosts.

devpod-provider-ssh provider is able to connect to the host IP, because ssh myserver understands ~/.ssh/config. However, I believe that devpod-provider-ssh passes -p 22 even when I haven't specified the port via the PORT config value. Flags override the values in ~/.ssh/config, so ssh tries to connect on the wrong port.

A fix could be to change it so that the default is not specified in provider.yaml, and we keep track of whether the port is explicitly specified or not, and we only pass -p 22 if PORT is explicitly specified.

I did find a workaround, which is to specify PORT explicitly with something like: devpod provider set-options -o PORT=10022

version v0.0.13 breaks on Windows

Hello,

we can't connect through SSH after upgrading to version v0.0.13+

OS is Windows and the result is:

image

Please make sure you have configured the correct SSH host and the following command can be executed on your system:
ssh -oStrictHostKeyChecking=no -oBatchMode=yes xxx@xxx echo Devpod Test
Try enabling Debug mode under Settings to see a more verbose output
init: exit status 1

This doesn't happen in v0.0.12.

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.