Skip to content
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

ConnectTimeout=15 in ssh command too short, no override option in settings #1761

Closed
nairbv opened this issue Oct 30, 2019 · 4 comments
Closed
Assignees
Labels
feature-request Request for new features or functionality ssh Issue in vscode-remote SSH verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@nairbv
Copy link

nairbv commented Oct 30, 2019

When attempting to connect to a remote host using RemoteSSH, I occasionally get connection failures due to timeouts.

The ssh command used includes the option -o ConnectTimeout=15, which for certain servers I'm trying to connect to is too short. Looking in the config options for the plugin, I don't see any way to configure ssh options (other than the ssh_config or the path to the command itself).

As a workaround, I've added a bash script that filters out the ConnectTimeout option before calling ssh, and pointed vs-code to my bash script instead of the system ssh command. An option to override this in the timeout setting would be preferable.

@nairbv
Copy link
Author

nairbv commented Nov 1, 2019

workaround ssh-wrapper:

#!/bin/bash

options=($@)
indexes=${!options[@]}

for index in ${indexes[@]}
do
    value=${options[$index]}
    if [[ $value =~ -o ]]
    then
        next=$((index + 1))
        option=${options[$next]}
        echo "checking option $option"
        if [[ $option =~ ConnectTimeout= ]]
        then
            echo "removing parameter: $value"
            unset -v 'options[$index]'
            echo "removing parameter: ${options[$next]}"
            unset -v 'options[$next]'
        fi
    fi
done

COMMAND="/usr/bin/ssh ${options[@]}"
echo $COMMAND
$COMMAND

@roblourens roblourens added feature-request Request for new features or functionality ssh Issue in vscode-remote SSH labels Nov 12, 2019
@roblourens roblourens added this to the November 2019 milestone Nov 12, 2019
@nairbv
Copy link
Author

nairbv commented Dec 12, 2019

@roblourens is this fixed now / is there an associated PR?

@roblourens
Copy link
Member

roblourens commented Dec 12, 2019

This is in today's nightly build of the extension. Unfortunately the code is not open source.

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 26, 2020
@roblourens roblourens added the verification-needed Verification of issue is requested label Jan 29, 2020
@roblourens
Copy link
Member

Verification steps: verify that the new setting remote.SSH.connectTimeout is respected

@JacksonKearl JacksonKearl added the verified Verification succeeded label Jan 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality ssh Issue in vscode-remote SSH verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants