VSCode SFTP deploy files from remote SSH server to a second remote SSH server - visual-studio-code

I have two remote SSH servers, server A (dev) and server B (production). When working on files on server A via SSH in VSCode, I want to be able to upload / sync files to server B using the SFTP plugin.
I can see how this is done when working on a local file system and then deploying via SFTP to a single remote SSH server, but I want to know if it's possible to deploy from one remote SSH server to another.
Any help greatly appreciated.

Related

Need help in solving Remote - SSH problem

Hello guys I am trying to do Remote SSH for quite some time and unable to make it work .
The problem :
Trying to connect to Aws Codecatalyst Dev environment Linux(remote ssh) to my local windows machine and it is in an endless loop of " Setting up SSH Host aws -exampleID".
I had tried it with my remote ubuntu aws workspace and it works flawlessly (ubuntu remote workspace to Aws codecatalyst Dev Environment) so it seems like some issue with my local machine .
Things I have tried:
When comparing the logs of failed vs successful I have noted that the remote.SSH.useLocalServer was true in my success log. So tried to add this to the settings.json but during run time it automatically changes from true to false .
Also tried clean uninstall and install couple of times (remove appData and ssh config files)
I have added an image of log of the failed Remote SSH .
Would appreciate if Remote SSH users can take a look into the logs and give their insights .
log of Remote SSH

VS Code Remote-SSH won't reconnect to one specific working directory on remote Ubuntu host

I'm using VSCode 1.72.2 with Remote-SSH v0.90.1 on Windows to develop against an AWS EC2 VM running Ubuntu 22.04 LTS. A couple days ago, I was working in my project source folder in /opt/t4/ on the target host. When I was finished, I stopped the VM from the AWS console, forgetting that VS Code was still SSHed in.
When I brought the VM back up, I can reconnect VS Code/Remote-SSH to the host as before, except that I can no longer connect using /opt/t4/ as my working directory. I can use any directory except the one I was using when I disconnected.
I can navigate down to it and work in it if I use /opt/ as my working directory. I can navigate to it by manually SSHing to the remote host. I can create a subfolder in a remote shell at /opt/t4/test/, and then connect VS Code using that subfolder as my working directory. I can see and select /opt/t4/ in the Open Folder dialog in VS Code. But when I try to connect using that working directory, the connection times out with a not-particularly-useful error message:
[00:05:49.867] SSH Resolver called for "ssh-remote+my.remote.host", attempt 2, (Reconnection)
[00:05:49.868] SSH Resolver called for host: my.remote.host
[00:05:49.868] Setting up SSH remote "my.remote.host"
[00:05:49.870] Using commit id "d045a5eda657f4d7b676dedbfa7aab8207f8a075" and quality "stable" for server
[00:05:49.872] Install and start server if needed
[00:05:49.874] Using SSH config file "C:\Users\me\.ssh\config"
[00:05:49.874] Running script with connection command: ssh -T -D 1518 -F "C:\Users\me\.ssh\config" "my.remote.host" bash
[00:05:49.875] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[00:06:06.876] Resolver error: Error: Connecting with SSH timed out
at g.Timeout (c:\Users\me\.vscode\extensions\ms-vscode-remote.remote-ssh-0.90.1\out\extension.js:1:585348)
at Timeout._onTimeout (c:\Users\me\.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)
[00:06:06.877] ------
I tried Remote-SSH: Uninstall VS Code Server from Host from VS Code.
I tried deleting ~/.vscode-server on the Linux host from an SSH session.
I tried Remote-SSH: Kill VS Code Server on Host from VS Code.
I tried Remote-SSH: Kill Local Connection Server for Host from VS Code.
I tried deleting and recreating the host connection details in the local config file from SSH-Remote.
I tried rebooting both local and target hosts.
I tried setting /opt/ as my working dir, then deleting and recreating /opt/t4. I was able to do this, but as soon as I try reconnecting using /opt/t4 as the working dir, VS Code still fails to connect.
I'm... stumped. My suspicion is that there is something corrupt cached Windows-side, but I don't know where to look for that.
Microsoft is aware and working on a fix. There are a variety of workarounds in this thread: https://github.com/microsoft/vscode-remote-release/issues/7324
Thanks to the link from #Mike Barry, I managed to find the local workspace for that target folder and delete it to force it to reinitialize, which cleared the issue.
Deleted C:\Users\me\AppData\Roaming\Code\User\workspaceStorage\[guid]\ and reconnected with no problem.

vscode remote ssh connection cannot connect on windows server 2022

I'm trying to setup Remote SSH extension on vscode to connect to a server that runs Windows Server 2022.
First, I can connect with SSH from the terminal ssh username#public_ip -p port then I enter the password and I can access the server.
I installed the Remote - SSH extension on vscode. I was able to connect to a Raspberry Pi without problems... But I cannot connect to a Windows Server 2022.
It asks me to enter the username password twice, then after a few seconds it stops with two errors pop-ups (see picture below).
Could not fetch remote environment
Failed to connect to the remote extension host server (Error: WebSocket close with status code 1006)
errors
Also, from another machine. I can connect to my server with vscode and the same extension (Windows Server 2022) without any problems so I don't think that the server has any issues. Seems like the problem is on my computer that won't connect.
I was able to connect once but I did break something and I don't know what. I tried to reinstall the extension but nothing helped.
EDIT:
I think I fixed it.
Here's what I did.
I uninstalled the Remote - SSH extension
I opened the settings.json on my local computer and deleted everything that had to do with this extension.
Deleted the config file from C:\Users\username\.ssh\config
I restarted vscode
Installed the extension
And it worked.

VB Code - Multiple Remote SSH connections to same server

Is it possible to connect several users via openSSH to the same VM so that everyone can access VB Code on the same VM machine and run scripts? thrue the local VB Code
If so, how do I do this?

How to connect eclipse from local to server

I have a eclipse on windows 7 system and I am trying some code on it.
But as my database is on server that is not my local systems so how can I connect eclipse to remote server so that I can write code on local and run on server.
Is it possible then please let me know and that server to which I want to connect that is Linux server.
Do you have to run your program remotely just because your database resides on the other server? Most databases allow connecting over TCP/IP.
Otherwise my suggestion is to add you public ssh key on the server, and then create a script which copies your class files and then executes your java program on your server, such as:
scp -r classfolder remoteuser#remotesystem:folderpath
ssh remoteuser#remotesystem java -cp folderpath the.created.Program
The public key removes the need for you to enter your password for each command.