Unable to open connection: Host does not exist - virtualenv

I have been to access Jupyter Notebook on remote server (on a gpu). I followed this guide but getting this error "Unable to open connection: Host does not exist" after running the following command:
C::\WINDOWS\system32> plink ssh -N -L localhost:8888:localhost:8889 remote_user#remote_host
OS: Windows
Using plink to create ssh tunnel.
Any idea what's going wrong ?

And again solved this problem by using this command:
plink -ssh -L 8888:localhost:8888 ml_test #ml_test is my putty session name, you can provide your username#remote-host
As mentioned in this question.

Related

VSCode RemoteSSH - connection timeout

Beginning today, I am unable to connect to my remote server in VSCode. The error in the output shows this repeating 5 times:
[15:34:11.799] SSH Resolver called for "ssh-remote+my-server", attempt 5, (Reconnection)
[15:34:11.805] SSH Resolver called for host: my-server
[15:34:11.808] Setting up SSH remote "my-server"
[15:34:11.819] Using commit id "d045a5eda657f4d7b676dedbfa7aab8207f8a075" and quality "stable" for server
[15:34:11.832] Install and start server if needed
[15:34:11.849] Running script with connection command: ssh -T -D 53101 "myserver" bash
[15:34:11.857] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[15:34:28.879] Resolver error: Error: Connecting with SSH timed out
at g.Timeout (c:\Users\username\.vscode\extensions\ms-vscode-remote.remote-ssh-0.90.1\out\extension.js:1:585348)
at Timeout._onTimeout (c:\Users\username\.vscode\extensions\ms-vscode-remote.remote-ssh-0.90.1\out\extension.js:1:679743)
at listOnTimeout (node:internal/timers:559:17)
at process.processTimers (node:internal/timers:502:7)
[15:34:28.948] ------
The port number in that SSH command is different for each attempt. If I copy that command out and run it in cmd manually from my local machine and add in -vvv, then I see the connection is successful and the prompt sits on "debug2: exec request accepted on channel 2" infinitely. I can't tell what the problem is. Is the local forwarding port failing to be created and listen on? Is there something with the remote server causing the timeout? Oddly, if I delete the .vscode-server directory on the remote and try to reconnect, then it actually does reinstall it fine. But I still get the error that VSCode can't connect to the remote server.
I forgot that the VSCode Remote extensions have their own repository. Turns out my issue is https://github.com/microsoft/vscode-remote-release/issues/7324
Ensuring that I set remote.SSH.useLocalServer to true in my user settings.json fixed the issue until it is resolved in-code.

Visual Studio Code Remote SSH Permission Denied (public key)

I'm using Mac OS and can succesfully connect via terminal and ssh to the host with the command
ssh -i ~/full/path/to/private_key name#ip
But when I try to use the exact same command in Visual Studio Code using Remote-SSH "Connect to Host", it returns me "Could not establish connection to "ip": Permission denied (publickey)".
How to fix it? I've tried to add my local public key to the authorized_keys on host, but it didn't help.
Ensure you have read-only access to the private key.
Run the following to do so.
chmod 400 ~/.ssh/<path_to_your_key.pem>
please try this..
After you click "Connect to Host", ONLY type in IP address (remove "ssh -i ~/full/path/to/private_key name#" from your example). It will then ask you to enter the passphrase for the ssh key. It should work if the passphrase is correct.
PS: Please also make sure you have the config information in the ssh configuration file ready. See details here.

remote ssh enable pseudo-tty allocation

After I finished the configuration of vscode remote-ssh extension, I got these logs as follows:
[19:02:36.743] Checking ssh with "ssh -V"
[19:02:36.766] > OpenSSH_7.9p1, LibreSSL 2.7.3
[19:02:36.771] Running script with connection command: ssh -T -D 64497 -o ConnectTimeout=15 'vscode_test' bash
[19:02:37.199] > 8474f269cd9b: running
Actually, I'm trying to connect the remote host using ssh without "-T", means using pseudo-tty. But I don't know how?
If you enable RequestTTY force in your .ssh/config under your host, that will override the -T.

Remote editing over ssh to windows server

Remote SSH plugin states VS Code Insiders has experimental support for Windows 10/Server 1803+ using the official OpenSSH server.
I have the official OpenSSH server installed and configured on Windows Server 2019 1809. I can connect via pubkey authentication and have PowerShell Core over ssh working as well. I tried both Remote SSH and Remote SSH nightly plugin. At first it was complaining that it couldn't find bash. So I installed git bash and added it to the system path. I get the following error when attempting to connect to my windows server:
[16:02:41.398] Log Level: 3
[16:02:41.399] remote-ssh-nightly#2019.12.24000
[16:02:41.399] darwin x64
[16:02:41.401] SSH Resolver called for "ssh-remote+myserver", attempt 1
[16:02:41.401] SSH Resolver called for host: myserver
[16:02:41.401] Setting up SSH remote "myserver"
[16:02:41.413] Using commit id "e74405d11443c5361c31e2bc341866d146eee206" and quality "insider" for server
[16:02:41.414] Testing ssh with ssh -V
[16:02:41.425] ssh exited with code: 0
[16:02:41.425] Got stderr from ssh: OpenSSH_7.9p1, LibreSSL 2.7.3
[16:02:41.430] Running script with connection command: ssh -T -D 51951 -o ConnectTimeout=15 myserver bash
[16:02:41.430] Install and start server if needed
[16:02:43.451] > 5122b1a5b835: running
> Unsupported architecture: MINGW64_NT-10.0-17763 x86_64
> 5122b1a5b835##27##
[16:02:43.452] Got some output, clearing connection timeout
[16:02:43.710] "install" terminal command done
[16:02:43.710] Install terminal quit with output: 5122b1a5b835##27##
[16:02:43.710] Received install output: 5122b1a5b835##27##
[16:02:43.710] Unsupported architecture
[16:02:43.711] Resolver error: The remote host's architecture is not supported
[16:02:43.714] ------
Anybody know the magic sauce to get Remote SSH working w/ Windows 10/Server?
Looks like VSCode is attempting to run bash on the server which I'm guessing would resolve to git's bash which is mingw based as I recall. VSCode should be running Powershell on the server.
Did you include your server in the list of windows remotes in the extension's settings?
Requires "remote.SSH.windowsRemotes" setting. Here is the documentation.
"remote.SSH.windowsRemotes": ["myserver"]

Failed to parse remote port from server output: bash: no job control in this shell

I am trying to use VSCode - Insiders to run code on a docker container in a remote AWS machine using the Remote - SSH plugin. I have opened a terminal and set up port forwarding like so: ssh -L 2201:localhost:2222 user#host -N -i ~/.ssh/id_rsa. Then in VSCode I try to connect to root#localhost and it starts up, but then gives me an error message:
> Found existing installation...
> Found running server...
>
> bash: no job control in this shell
"install" terminal command done
Received install output: bash: no job control in this shell
Failed to parse remote port from server output: bash: no job control in this shell
I started doing this process a couple days ago and it worked. Yesterday it was in and out a bit, and today it's not working at all. I've tried turning it off and on again, but can't get it to work. In case it's relevant, I am on MacOS with the Mojave OS.
Edit:
Magically, it worked today (the following day) the first time. I would still be interested in knowing how to fix this next time it breaks. In case this helps, here's the output from when it is working:
SSH Resolver called for "ssh-remote+7b22686..."
SSH Resolver called for host: root#localhost
Setting up SSH remote "localhost"
Using commit id "473af338..." and quality "insider" for server
Using SSH config file "/Users/user/config"
Install and start server if needed
> Found existing installation...
> Found running server...
>
> bash: no job control in this shell
> 368805d0-03...==38466==
"install" terminal command done
Received install output: 368805d0-03...==38466==
Server is listening on port 38466
Using SSH config file "/Users/user/config"
Spawning tunnel with: ssh -F /Users/user/config root#localhost -N -L localhost:39003:localhost:38466
Spawned SSH tunnel between local port 39003 and remote port 38466
Waiting for ssh tunnel to be ready
Tunneling remote port 38466 to local port 39003
Resolving "ssh-remote+7b22686f737..." to "localhost:39003", attempt: 1
Edit 2: And now (the following following day) it's not working again.
Edit 3: I have a config file at ~/config. Here are the contents:
Host *
User root
Port 2201
IdentityFile ~/id_rsa
In the specific implementation shown above, you have User root in your config and are logging in with root#localhost, so you have your username twice. Leave the config file as is and just enter localhost in VSCode. This still doesn't solve the instability issue, but it does fix one problem.
I have the same issue when configuring my server. It solved by this issue. After save your config file for remote server, change the remote shell path like this issue, and then connect, you will in.
https://github.com/microsoft/vscode-remote-release/issues/220#issuecomment-490374437