vscode-sftp: Can't use .ssh/config alias with HostName
Do you read the FAQ?
Describe the bug If I try to connect to a host defined on my .ssh/config when an alias (and a HostName), the plugin replies with: getaddrinfo ENOTFOUND. I can use the same alias with SSH and it works just fine.
To Reproduce Steps to reproduce the behavior:
- Create an entry in your .ssh/config using a non-address alias as “Host” and the correct server address in “HostName”
- Configure it on the VSCode SFTP plugin.
- Try to do anything that uses that SFTP connection.
- See error.
Expected behavior The plugin should connect correctly when using the SSH_AGENT and the configuration from .ssh/config.
Current SFTP config
{
"protocol": "sftp",
"host": "rpi-rsa",
"port": 22,
"username": "rpi",
"remotePath": "/home/pi/Test",
"agent": "$SSH_AUTH_SOCK"
}
Current .ssh/config section for that Host:
Host rpi-rsa
HostName XXXXX.XXXXX.XXX
User pi
IdentityFile ~/.ssh/id_rsa-personal
Desktop (please complete the following information):
- OS: Tried on Mac and Linux
- VSCode Version 1.29.0
- Extension Version 1.7.5
Extension Logs - required
[info] config at /home/rixzz/Documents/Git/XXXXXXXX {"remotePath":"/home/pi/Test","uploadOnSave":false,"downloadOnOpen":false,"ignore":[],"concurrency":4,"protocol":"sftp","connectTimeout":10000,"interactiveAuth":false,"secure":false,"passive":false,"remoteTimeOffsetInHours":0,"port":22,"host":"rpi-rsa","username":"******","agent":"$SSH_AUTH_SOCK","user":"pi","privatekey":"~/.ssh/id_rsa-personal"}
[trace] run command 'Upload Project'
[trace] handle upload folder for /home/rixzz/Documents/Git/XXXXXXXX
[debug] Local ident: 'SSH-2.0-ssh2js0.2.1'
[debug] Client: Trying rpi-rsa on port 22 ...
[error] Error: [rpi-rsa]: getaddrinfo ENOTFOUND rpi-rsa rpi-rsa:22
at Client.client.on.on.err (/home/rixzz/.vscode/extensions/liximomo.sftp-1.7.5/out/src/core/remote-client/sshClient.js:229:28)
at emitOne (events.js:121:20)
at Client.emit (events.js:211:7)
at Socket.<anonymous> (/home/rixzz/.vscode/extensions/liximomo.sftp-1.7.5/node_modules/ssh2/lib/client.js:300:10)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at emitErrorNT (internal/streams/destroy.js:64:8)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15 (7 by maintainers)
Same issue. One PC works, the another one not. Two fresh installations. VSC 1.31.1, SFTP 1.93
[warn] ENOENT: no such file or directory, open ‘C:\Users\NAME.ssh\config’ load C:\Users\NAME.ssh\config failed [error] Error: Config Not Found. (file://nashome/Web/pathto/websites/path/blabla.php) at Object.u [as handleCtxFromUri] (C:\Users\NAME.vscode\extensions\liximomo.sftp-1.9.3\dist\extension.js:1:41646) … The sftp-connection works, but not the upload/download…
Ups, sorry for that one. Now is working. Thanks!
Do you know when the fix will be available in the release version?