-
Notifications
You must be signed in to change notification settings - Fork 310
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
using localusername vs remoteusername #2102
Comments
I think you need a Host that doesn't match the HostName, if you change it to some other name does that work? |
I am running into same issue. @roblourens I tried using a host that does not match the hostname, that does not seem to work. From the vs code output |
It won't be in that command, ssh will read it from the config file. Please make sure that it is actually seeing the correct ssh config file. |
If I change the host to anything other than the remote servers ip address, then it fails to resolve it: " ssh: Could not resolve hostname hostname: Name or service not known" [21:06:37.661] remote-ssh@0.47.2
[21:06:47.973] "install" terminal command done |
Then it's not finding your config file. What's the path to the config file? This needs to work from an external terminal - |
It seems like my ssh config file had something incorrect with so many servers in it. I moved this remote server to the top and that worked. Thank you for your response. |
@roblourens I don't understand why you would think the config file can't be found... how would the config show up in the Remote Explorer sidebar if the config file wasn't found? The config file is
(replacing my actual user name with "LocalUser for privacy) and it currently contains
actual data replaced with anon equivalence for privacy. E.g. the IP address is not actually 1.2.3.4 obviously, and the Host is just a name I made up, not actually "ChatServer" (previously, I called the Host "HostName" but now I'm replacing it with "ChatServer" so there is no confusion with the HostName parameter in the config file. My username on that remote system is not actually "remoteuser" but IS my valid username. In my prior entry here, the line: I don't understand this at all:
What do you mean by "external terminal"? Command prompt? Unix terminal window? Are you talking about the path to the ssh program? If I do I don't know how to edit the command line options for Git ssh and I have no idea what the -T and -D options are doing, but if I open a command prompt and from |
VS Code looks for the ssh config file in that location but the ssh program should also be looking for it there. VS Code is finding it but ssh.exe is doing something weird. In your example,
|
Are you sure that's how Git ssh works? If you want it to use a config file, I believe you have to add the -F flag. If you specify a parameter without a flag, it's expected to be a fqdn or ip address to the server. -vvv is certainly not an option for the Git ssh program. Here is the help:
Is the issue that remote explorer does not support Git ssh? Is there another ssh program you know works under Windows? |
No, it should read the ssh config files from their default locations without using the -F flag. And that is not a complete listing of all flags. Just try it. You should see output like this
|
|
Thanks, now can you try it with the verbose flag so it will log where it is looking for a config file? |
So in that case, it's looking in a place that doesn't exist for the config.. It's a windows machine so there is no /etc folder. On the off chance, I tried: And that works! The -F specifies the config file, but you apparently have to give it the name of the entry to use in the config file. So now the question is, how does one configure Git ssh to look in the right place.? Google finds: I assume the right thing to do at this point is close this issue. If someone else has the same problem, they can see if they have the same HOME environmental variable issue and if they are willing to change it, then they can see if that fixes the problem. |
I have the same problem: local user is used instead of remote user, that settled in .ssh config file. |
Thanks for confirming, @JamesNewton. I guess I have no clue why it has worked on the windows machines I've tested, where HOME is not set. You can also set the Maybe I should just always set -F, I'm not sure. I wanted ssh to do the right thing itself. |
This appears to be related: #1146 Setting the When I tried to edit a file, the connection was lost and the I couldn't connect to it at all. I've restarted the VM (It's a google compute engine). Interestingly enough, they changed the external IP as a result, which confused me until I realized it. LOL. Now I can connect via their web interface and via PuTTY again, and the SFTP extension works for me. I'm a big gun shy but I'm sure it was just a coincidence. I'll give it another go tomorrow. |
same issue here. setting the configFile in VSCode resolves this issue. Also the known_hosts file has a similiar issue. The extension saves to the drive H: and ignores the one in the userprofile. (i guess because of reolving /h/.ssh/ to the drive H: instead of home. |
Closing this in favor of #2512 |
Issue Type: Bug
For some reason, it's apparently calling the git ssh client without specifying the user name I've entered in the config file. It's using the Windows user name (which I've replaced here with "localusername") instead of "remoteusername" as specified on the .ssh config file:
Here is the output:
[22:08:14.043] remote-ssh@0.47.2
[22:08:14.043] win32 x64
[22:08:14.047] SSH Resolver called for "ssh-remote+1.2.3.4", attempt 1
[22:08:14.047] SSH Resolver called for host: 1.2.3.4
[22:08:14.047] Setting up SSH remote "1.2.3.4"
[22:08:14.085] Using commit id "asdfas" and quality "stable" for server
[22:08:14.087] Testing ssh with ssh -V
[22:08:14.091] Got error from ssh: spawn ssh ENOENT
[22:08:14.091] Testing ssh with C:\Windows\System32\OpenSSH\ssh.exe -V
[22:08:14.093] Got error from ssh: spawn C:\Windows\System32\OpenSSH\ssh.exe ENOENT
[22:08:14.093] Testing ssh with C:\Program Files\Git\usr\bin\ssh.exe -V
[22:08:18.674] ssh exited with code: 0
[22:08:18.674] Got stderr from ssh: OpenSSH_7.6p1, OpenSSL 1.0.2n 7 Dec 2017
[22:08:18.682] Running script with connection command: "C:\Program Files\Git\usr\bin\ssh.exe" -T -D 60247 1.2.3.4 bash
[22:08:18.703] Install and start server if needed
[22:08:18.706] Terminal shell path: C:\Windows\System32\cmd.exe
[22:08:19.015] >
[22:08:19.015] Got some output, clearing connection timeout
[22:08:19.649] > localusername@1.2.3.4: Permission denied (publickey).
Notice it doesn't specify the remote username on the command for git ssh, and the error message indicates the localusername was used instead.
I am able to connect to the remote server via PuTTY using a key file and the correct remote user name.
Extension version: 0.47.2
VS Code version: Code 1.38.1 (b37e54c98e1a74ba89e03073e5a3761284e3ffb0, 2019-09-11T13:35:15.005Z)
OS version: Windows_NT x64 6.1.7601
System Info
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
oop_rasterization: unavailable_off
protected_video_decode: unavailable_off
rasterization: unavailable_off
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: disabled_off
webgl: enabled
webgl2: enabled
The text was updated successfully, but these errors were encountered: