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

Can't connect to Linux Target using Connection Manager #132

Closed
jazzatar opened this issue Apr 18, 2017 · 39 comments
Closed

Can't connect to Linux Target using Connection Manager #132

jazzatar opened this issue Apr 18, 2017 · 39 comments
Assignees

Comments

@jazzatar
Copy link

jazzatar commented Apr 18, 2017

  • A brief description
    Trying to add a remote SSH connection to connection manager in VS2017 fails.

  • Expected results
    Connection is added successfully

  • Actual results (with build output window contents if applicable)
    Red box appears around IP address in "Connect to Remote System" window

  • VC++ version, Linux system name and version, GCC/GDB/gdbserver version, CPU arch, etc. If you are using a specific version of Linux on an embedded board, we might need to know about it to get a repro on similar hardware
    Microsoft Visual Studio Professional 2017
    Version 15.1 (26403.3) Release
    VisualStudio.15.Release/15.1.0+26403.3
    Microsoft .NET Framework
    Version 4.6.01055

Installed Version: Professional

Visual C++ 2017 00369-60000-00001-AA090
Microsoft Visual C++ 2017

Visual C++ for Linux Development 1.0.6
Visual C++ for Linux Development

Target Info
Linux AB3SN 3.12.37-rt51 #1 SMP Wed Apr 12 11:11:26 PDT 2017 ppc64 GNU/Linux
OpenSSH_7.1p2, OpenSSL 1.0.1i 6 Aug 2014

  • Steps required to reproduce the error
    Go to Tools menu, select Options, Select Cross Platform > Connection Manager from list on Left. Click "Add Button" and supplied all information

  • Required packages and commands to install

  • Additional notes
    I am able to connect using WinSCP with SCP and SFTP, as well as Putty. All with the same account and IP information supplied in Visual Studio.
    I want to note I am able to set up a connection to an x64 Fedora System successfully. I've copied the sshd_config from the working system to the target that is not working as a troubleshooting step.

Thanks for help - I'm excited to get this toolchain working as Visual Studio is my preferred IDE!

@forceprojectx
Copy link

Since your target looks like its not a x86/64, I wonder if your issue is similar to the arm8 one. #110 (comment)

@bvital1976
Copy link

I have similar issue:
Visual Studio 2015,
Visual C++ for Linux Development 1.0.7
Target OS: Centos 5.9 x86_64 (relatively small install)

The same OS with X Windows works fine.

Is their any log produced by "Connect to Remote System"?

Thank you.

@PaloMraz
Copy link

The same here - trying to connect to HP ThinPro 6.1 (which is their distro of Ubuntu 14.04.3 LTS, AFAIK). WinSCP & PuTTY both work with the IP:PORT + account info (I am using Authentication type = Password).

VS info:
Microsoft Visual Studio Enterprise 2017
Version 15.1 (26403.7) Release
VisualStudio.15.Release/15.1.0+26403.7
Microsoft .NET Framework
Version 4.6.01586
Visual C++ 2017 00369-60000-00001-AA764
Visual C++ for Linux Development 1.0.6

@Dylan-Ying
Copy link

I have similar issue. PuTTY works fine.
Target OS: Ubuntu 14.04.5 LTS
SSH Server: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.8, OpenSSL 1.0.1f 6 Jan 2014
VS info:
Microsoft Visual Studio Enterprise 2017
Version 15.2 (26430.16) Release
VisualStudio.15.Release/15.2.0+26430.16
Microsoft .NET Framework
Version 4.7.02046
Visual C++ 2017 00369-90000-00000-AA724
Visual C++ for Linux Development 1.0.6

devenv_exe_linux_connection_error_104344_080217.log

liblinux.Ssh.Common.SshException: Channel was closed.
liblinux.Ssh.SubsystemSession.WaitOnHandle(WaitHandle waitHandle, TimeSpan operationTimeout)
liblinux.Ssh.Sftp.SftpSession.OnChannelOpen()
liblinux.Ssh.SubsystemSession.Connect()
liblinux.Ssh.SftpClient.OnConnected()
liblinux.Ssh.BaseClient.Connect()
liblinux.IO.RemoteFileSystemImpl.ConnectCore()
liblinux.IO.RemoteFileSystemImpl.Connect(PasswordConnectionInfo passwordConnectionInfo)
liblinux.IO.RemoteFileSystemImpl.Connect()
liblinux.IO.RemoteFileSystemImpl.Connect(IRemoteSystemBare remoteSystem)
liblinux.RemoteSystem.get_FileSystem()
liblinux.DistributionId.GetSystemId(IRemoteSystem remoteSystem)
liblinux.DistributionId.GetDistributionId(IRemoteSystem remoteSystem)
liblinux.SystemProperties.Populate()
liblinux.SystemProperties..ctor(IRemoteSystem remoteSystem)
liblinux.UnixSystem.get_Properties()
SSHConnectionUI.MainWindow.login_Click(Object sender, RoutedEventArgs e)

@x893
Copy link

x893 commented Nov 25, 2017

I resolve this issue after install OpenSSH with SFTP support (from Dropbear).
On some system need change uname -m response.
Rename /bin/uname to /bin/uname-org and make new uname with ARM response

#!/bin/bash

if [ "$1" == "-m" ]
then
echo ARM
exit 0
fi
uname-org $1
exit 0

For more info see liblinux.dll DistributionId.GetSystemHardwarePlatform method

@gvd1024
Copy link

gvd1024 commented Jan 31, 2018

I am also having this problem.

x893, I am happy that you solved it.

However your explination of how you fixed it is a bit beyond my comprehension.

Can you please go into a bit more detail?

How/where did you install OpenSSH (I downloaded/extracted the openssh-7.5.tar.gz file but don't see any executables or applications in it)

Is there a special version of OpenSSH that has SFTP support (I didn't see any)?

How do I get Visual Studio to use OpenSSH once it is installed?

Where/how do I rename the uname -m response?

I would be very grateful if you could help me with this.

Thank you in advance.

@lukka
Copy link
Member

lukka commented Jan 31, 2018

@jazzatar @gvd1024 @PaloMraz
could you please check you installed also sftp support for ssh?
On Ubuntu it is the following package:
openssh-sftp-server

@gvd1024 Please use the package manager of your Linux distribution for installing ssh support on your Linux machine, e.g. apt on Debian-like, zypper on Suse and so forth

@rblinton
Copy link

I have a similar issue. I have verified openssh-sftp-server is installed.

@lukka
Copy link
Member

lukka commented Mar 29, 2018

@rblinton could you please report the information related to the remote machine so that would allow us to reproduce the problem? e.g. distro name and version, list of packages installed along with version, thanks.

@rblinton
Copy link

rblinton commented Mar 29, 2018

You guys have a conflict with port 22. I solved the problem using this: https://superuser.com/questions/1123552/how-to-ssh-into-wsl

Ubuntu 16.04.4 (Linux version 4.4.0-43-Microsoft)
gcc version 5.4.0
OpenSSH_7.2p2 Ubuntu-4ubutu2.4, OpenSSL 1.0.2g
Visual Studio.15.Release/15.6.4+27428.2015
Microsoft .NET Framework Version 4.7.02556
Visual C++ 2017 00369-60000-00001-AA266
Visual C++ for Linux Development 1.0.8

@itodirel itodirel self-assigned this Apr 5, 2018
@jdsarode
Copy link

@jazzatar @rblinton @0x79696e67

I am also facing the same issue in VS2017 where I am able to connect to Linux Target via putty, other clients. But, when I try to connect target using CrossPlatform connection manager in VC2017, redbox appears on the host label and I get the following logs . Has this issue been solved ? Please point me to the right answer thread as I am not able to resolve this.

Logs :-
liblinux.Ssh.Common.SshException: Channel was closed.
at liblinux.Ssh.SubsystemSession.WaitOnHandle(WaitHandle waitHandle, TimeSpan operationTimeout)
at liblinux.Ssh.Sftp.SftpSession.OnChannelOpen()
at liblinux.Ssh.SubsystemSession.Connect()
at liblinux.Ssh.SftpClient.OnConnected()
at liblinux.Ssh.BaseClient.Connect()
at liblinux.IO.RemoteFileSystemImpl.ConnectCore()
at liblinux.IO.RemoteFileSystemImpl.Connect(PasswordConnectionInfo passwordConnectionInfo)
at liblinux.IO.RemoteFileSystemImpl.Connect()
at liblinux.IO.RemoteFileSystemImpl.Connect(IRemoteSystemBare remoteSystem)
at liblinux.RemoteSystem.get_FileSystem()
at liblinux.DistributionId.GetSystemId(IRemoteSystem remoteSystem)
at liblinux.DistributionId.GetDistributionId(IRemoteSystem remoteSystem)
at liblinux.SystemProperties.Populate()
at liblinux.SystemProperties..ctor(IRemoteSystem remoteSystem)
at liblinux.UnixSystem.get_Properties()
at SSHConnectionUI.MainWindow.login_Click(Object sender, RoutedEventArgs e)

@lukka
Copy link
Member

lukka commented Apr 20, 2018

@jdsarode could you please provide more information about your setup? For example, if you are trying to connect to a Debian-like distribution on a remote Linux box (non WSL), please check whether you installed the package "openssh-sftp-server" with apt.

@jdsarode
Copy link

@lukka :- I think there has to be "openssh-sftp-server" package as I am able to log in to the system using other ssh applications such as putty, tera term.

@lukka
Copy link
Member

lukka commented Apr 20, 2018

@jdsarode please run 'dpkg -l | grep sftp' and report the output of the command. Then we could verify whether that package is missing.

@jdsarode
Copy link

@lukka - after investigating my system, I see that openssh-sftp-server package is NOT included in the system. Would it mandatory from system side to add this support ? OR is there any other way that we can do this on MSVC side.

@lukka
Copy link
Member

lukka commented Apr 27, 2018

@jdsarode the "sftp over ssh" support must be available on the Linux machine, it is an extension of the SSH protocol. It can be either that:

  • there are different packages for the Linux distribution you are using, one for sshserver (e.g. openssh-server) and one for sftp;
  • it might be that sftp already included in the ssh server package, and it just need to be enabled; you could check the /etc/ssh/sshd_config file whether it contains
    Subsystem sftp internal-sftp
    or
    Subsystem sftp /usr/lib/openssh/sftp-server

Which distribution of Linux are you using?

@VladimirAkopyan
Copy link

VladimirAkopyan commented May 8, 2018

@lukka confirm, got same issue here. FileZilla, putty and TerraTerm authenticate just fine. Tried using docker and on a remote machine, same effect.
image

To Reproduce:

Grab a container from my dockerHub

docker run -p 2222:2222 -d clumsypilot/dotnetdebug:vs2017_connect_issue

You will find that you can connect using username root and pwd Docker! with putty, but not with VS2017

See the repo for a private key (can also be used) and for the docker files. It's openssh with mostly default settings
Github: https://github.com/VladimirAkopyan/DockerDotnetDebug

@lukka
Copy link
Member

lukka commented May 8, 2018

@VladimirAkopyan
Please could you check whether "sftp over ssh" support is available on target?
You could check this in /etc/ssh/sshd_config file whether it must contain
Subsystem sftp internal-sftp
or
Subsystem sftp /usr/lib/openssh/sftp-server

@VladimirAkopyan
Copy link

@lukka my bad, I misunderstood openSSH docs, and thoughts that
Subsystem sftp internal-sftp is enabled by default.
Is there documentation for this? I think a lot of ppl are hitting this problem

@lukka
Copy link
Member

lukka commented May 12, 2018

@VladimirAkopyan we need to improve our error message indeed.
By the way, did enabling sftp solved the problem?

@VladimirAkopyan
Copy link

Yep, the issue is gone now

@jainyzau
Copy link

@lukka Hello, I still have this problem, would you please help me? Thank you.

My environment is:
CentOS 7.5 x86_64,
Visual Studio 2017 Community 15.7.6
Visual C++ for Linux Development 1.0.9

I have checked the sftp in sshd_config, and it's enabled I think.

# override default of no subsystems
Subsystem       sftp    /usr/libexec/openssh/sftp-server

Where I can get more logs for this error? I chcked /var/log/secure, and it seems good.

Aug 13 11:07:57 chengdudev245 sshd[3040]: Received disconnect from 10.0.2.2 port 50960:11: Connection terminated by the client.
Aug 13 11:07:57 chengdudev245 sshd[3040]: Disconnected from 10.0.2.2 port 50960
Aug 13 11:07:57 chengdudev245 sshd[3032]: pam_unix(sshd:session): session closed for user hzhao
Aug 13 11:08:14 chengdudev245 sshd[3079]: Accepted password for hzhao from 10.0.2.2 port 50995 ssh2
Aug 13 11:08:14 chengdudev245 sshd[3083]: Accepted password for hzhao from 10.0.2.2 port 50996 ssh2
Aug 13 11:08:14 chengdudev245 sshd[3079]: pam_unix(sshd:session): session opened for user hzhao by (uid=0)
Aug 13 11:08:14 chengdudev245 sshd[3083]: pam_unix(sshd:session): session opened for user hzhao by (uid=0)
Aug 13 11:10:23 chengdudev245 sudo:   hzhao : TTY=pts/1 ; PWD=/home/hzhao ; USER=root ; COMMAND=/bin/vim /etc/ssh/sshd_config
Aug 13 11:12:06 chengdudev245 sshd[3087]: Received disconnect from 10.0.2.2 port 50995:11: Connection terminated by the client.
Aug 13 11:12:06 chengdudev245 sshd[3087]: Disconnected from 10.0.2.2 port 50995
Aug 13 11:12:06 chengdudev245 sshd[3079]: pam_unix(sshd:session): session closed for user hzhao

@jainyzau
Copy link

@lukka Sorry for disturbing. No need to investigate it now. It's caused by one of our system setting. I don't know the reason at this moment, but when I comment out our specified setting in .bashrc, it works.

@lukka
Copy link
Member

lukka commented Aug 14, 2018

@jainyzau thanks for the report.
Could you please advice what is the settings in .bashrc that interfere with the copy of the sources?
By the way, could you please switch to 'rsync' as source copy method, instead of "sftp"?
Thanks for your support!

@IakovK
Copy link

IakovK commented Oct 15, 2018

I have the same problem.
Visual Studio Prof 15.7.6 against opensuse Leap 42.3.
Do the same as the start message described and receive the same result.
With putty all works, sftp works too (from putty package).
sshd log shows following for putty:
Oct 15 15:54:46 atlas-suse sshd[19393]: Connection from 192.168.0.6 port 60584 on 192.168.0.7 port 22
Oct 15 15:54:51 atlas-suse sshd[19393]: Postponed keyboard-interactive for jacob from 192.168.0.6 port 60584 ssh2 [preauth]
Oct 15 15:54:53 atlas-suse sshd[19393]: Postponed keyboard-interactive/pam for jacob from 192.168.0.6 port 60584 ssh2 [preauth]
Oct 15 15:54:53 atlas-suse sshd[19393]: Accepted keyboard-interactive/pam for jacob from 192.168.0.6 port 60584 ssh2
Oct 15 15:54:53 atlas-suse sshd[19393]: pam_unix(sshd:session): session opened for user jacob by (uid=0)

and the following for Visual Studio:
Oct 15 15:37:57 atlas-suse sshd[19312]: Connection from 192.168.0.6 port 60515 on 192.168.0.7 port 22

(only one line)

That makes me believe that Visual Studio does something wrong.

@IakovK
Copy link

IakovK commented Oct 15, 2018

I set sshd log level to maximum (DEBUG3) and here is the result:
Oct 16 00:45:43 atlas-suse sshd[22091]: Connection from 192.168.0.5 port 51097 on 192.168.0.7 port 22
Oct 16 00:45:43 atlas-suse sshd[22091]: debug1: Client protocol version 2.0; client software version Ssh.SshClient.0.0.1
Oct 16 00:45:43 atlas-suse sshd[22091]: debug1: no match: Ssh.SshClient.0.0.1
Oct 16 00:45:43 atlas-suse sshd[22091]: debug1: Enabling compatibility mode for protocol 2.0
Oct 16 00:45:43 atlas-suse sshd[22091]: debug1: Local version string SSH-2.0-OpenSSH_7.2
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: fd 3 setting O_NONBLOCK
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: ssh_sandbox_init: preparing seccomp filter sandbox
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: Network child is on pid 22092
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: preauth child monitor started
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: privsep user:group 498:498 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug1: permanently_set_uid: 498/498 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: ssh_sandbox_child: setting PR_SET_NO_NEW_PRIVS [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: ssh_sandbox_child: attaching seccomp filter program [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug1: list_hostkey_types: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ssh-dss,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: send packet: type 20 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug1: SSH2_MSG_KEXINIT sent [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: receive packet: type 20 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug1: SSH2_MSG_KEXINIT received [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: local server KEXINIT proposal [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: KEX algorithms: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: host key algorithms: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ssh-dss,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: compression ctos: none,zlib@openssh.com [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: compression stoc: none,zlib@openssh.com [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: languages ctos: [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: languages stoc: [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: first_kex_follows 0 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: reserved 0 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: peer client KEXINIT proposal [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: KEX algorithms: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: host key algorithms: ssh-rsa,ssh-dss [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: ciphers ctos: aes256-ctr,3des-cbc,aes128-cbc,aes192-cbc,aes256-cbc,blowfish-cbc,twofish-cbc,twofish192-cbc,twofish128-cbc,twofish256-cbc,arcfour,arcfour128,arcfour256,cast128-cbc,aes128-ctr,aes192-ctr [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: ciphers stoc: aes256-ctr,3des-cbc,aes128-cbc,aes192-cbc,aes256-cbc,blowfish-cbc,twofish-cbc,twofish192-cbc,twofish128-cbc,twofish256-cbc,arcfour,arcfour128,arcfour256,cast128-cbc,aes128-ctr,aes192-ctr [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: MACs ctos: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha2-256-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-md5-96,hmac-sha1-96 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: MACs stoc: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha2-256-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-md5-96,hmac-sha1-96 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: compression ctos: none [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: compression stoc: none [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: languages ctos: [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: languages stoc: [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: first_kex_follows 0 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: reserved 0 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug1: kex: algorithm: diffie-hellman-group-exchange-sha256 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug1: kex: host key algorithm: ssh-rsa [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug1: kex: client->server cipher: aes256-ctr MAC: hmac-sha1 compression: none [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug1: kex: server->client cipher: aes256-ctr MAC: hmac-sha1 compression: none [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug1: kex: diffie-hellman-group-exchange-sha256 need=32 dh_need=32 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_request_send entering: type 120 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_request_receive_expect entering: type 121 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_request_receive entering [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_request_receive entering
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: monitor_read: checking request 120
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_request_send entering: type 121
Oct 16 00:45:43 atlas-suse sshd[22091]: debug1: kex: diffie-hellman-group-exchange-sha256 need=32 dh_need=32 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_request_send entering: type 120 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_request_receive_expect entering: type 121 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_request_receive entering [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_request_receive entering
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: monitor_read: checking request 120
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_request_send entering: type 121
Oct 16 00:45:43 atlas-suse sshd[22091]: debug1: expecting SSH2_MSG_KEX_DH_GEX_REQUEST [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: receive packet: type 34 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug1: SSH2_MSG_KEX_DH_GEX_REQUEST received [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_request_send entering: type 0 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_choose_dh: waiting for MONITOR_ANS_MODULI [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_request_receive_expect entering: type 1 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_request_receive entering [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_request_receive entering
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: monitor_read: checking request 0
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_answer_moduli: got parameters: 2048 2048 8192
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_request_send entering: type 1
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: monitor_read: 0 used once, disabling now
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_choose_dh: remaining 0 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug1: SSH2_MSG_KEX_DH_GEX_GROUP sent [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: send packet: type 31 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: bits set: 1010/2048 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug1: expecting SSH2_MSG_KEX_DH_GEX_INIT [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: receive packet: type 32 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: bits set: 1029/2048 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_key_sign entering [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_request_send entering: type 6 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_key_sign: waiting for MONITOR_ANS_SIGN [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_request_receive_expect entering: type 7 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_request_receive entering [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_request_receive entering
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: monitor_read: checking request 6
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_answer_sign
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_answer_sign: hostkey proof signature 0x559d09724bb0(271)
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_request_send entering: type 7
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: monitor_read: 6 used once, disabling now
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: send packet: type 33 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: send packet: type 21 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: set_newkeys: mode 1 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug1: rekey after 4294967296 blocks [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug1: SSH2_MSG_NEWKEYS sent [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug1: expecting SSH2_MSG_NEWKEYS [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: receive packet: type 21 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug1: SSH2_MSG_NEWKEYS received [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: set_newkeys: mode 0 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug1: rekey after 4294967296 blocks [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug1: KEX done [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: receive packet: type 5 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: send packet: type 6 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: receive packet: type 50 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug1: userauth-request for user jacob service ssh-connection method none [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug1: attempt 0 failures 0 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_getpwnamallow entering [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_request_send entering: type 8 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_getpwnamallow: waiting for MONITOR_ANS_PWNAM [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_request_receive_expect entering: type 9 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_request_receive entering [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_request_receive entering
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: monitor_read: checking request 8
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_answer_pwnamallow
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: parse_server_config: config reprocess config len 468
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_answer_pwnamallow: sending MONITOR_ANS_PWNAM: 1
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_request_send entering: type 9
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: monitor_read: 8 used once, disabling now
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: input_userauth_request: setting up authctxt for jacob [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_start_pam entering [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_request_send entering: type 100 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_inform_authserv entering [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_request_send entering: type 4 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: input_userauth_request: try method none [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: userauth_finish: failure partial=0 next methods="publickey,keyboard-interactive" [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: send packet: type 51 [preauth]
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_request_receive entering
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: monitor_read: checking request 100
Oct 16 00:45:43 atlas-suse sshd[22091]: debug1: PAM: initializing for "jacob"
Oct 16 00:45:43 atlas-suse sshd[22091]: debug1: PAM: setting PAM_RHOST to "192.168.0.5"
Oct 16 00:45:43 atlas-suse sshd[22091]: debug1: PAM: setting PAM_TTY to "ssh"
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: monitor_read: 100 used once, disabling now
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_request_receive entering
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: monitor_read: checking request 4
Oct 16 00:45:43 atlas-suse sshd[22091]: debug3: mm_answer_authserv: service=ssh-connection, style=
Oct 16 00:45:43 atlas-suse sshd[22091]: debug2: monitor_read: 4 used once, disabling now
This must give some hints about what is wrong with connection, but I am out of ideas.

@jonathan-daniel
Copy link

jonathan-daniel commented Oct 22, 2018

Same issue, all ssh clients work except visual studio

VS version: 15.8.5
Remote: SUSE Linux Enterprise Server 11 (x86_64)

@IakovK
Copy link

IakovK commented Oct 22, 2018

I have resolved my issue but with some trickery:

  1. by careful examining Visual Studio linux extension I found that it used something like ssh.net (in liblinux module). It is sort of confirmed in the ThirdPartyNotices.txt file. So, I tried to make the connection using that package, to the same host using the same credentials.
    I got an exception.
    I don't remember exact message, but it is something like "invalid authentication method: only console and certificate is configured". Console is what putty uses, I guess.
    That made me think that my linux box was misconfigured. I added password to the sshd authentication methods and now it passed this point.
    Moral - or feature request to Microsoft:
    in cases like this show the exception message to the user. My current state (after fixing the sshd config) shows that it is possible:
    I am having the mesage box that says,
    An error has occured. Could not find the 'zip' archiver, please install it using your system package manager.. Please see C:\Users\jacob\AppData\Local\Temp\vslinux_header_update_log.txt for more information.
    Quite clear what to do.
    Please, do something like that (that is, show error mesage) in other cases.

@itodirel
Copy link
Member

Hi, we are working on adding additional logging specially for SSH, and we'll be sure we log that here, please let me know if there are any issues here, and I'd happily reactivate and look into it, we are trying to get the issue list number down, so tentatively closing

@thomas-dee
Copy link

If anyone stumbles across that issue again:

Subsystem sftp /usr/lib/openssh/sftp-server did not work for me but
Subsystem sftp internal-sftp did work.

@wburchard
Copy link

Encountered this issue using both Visual Studio 2019 (and 2017). Could not not connect to Ubuntu 18.04 running in Hyper-V (created using Microsoft provided image). Finally got it to work by disabling Pam authentication, and enabling password authentication:

sudo nano /etc/ssh/sshd_config

PasswordAuthentication yes
ChallengeResponseAuthentication yes
UsePAM no

Figured this out by enabling DEBUG logging in sshd_config, then using the following command to view messages:

sudo journalctl -u ssh

Log entries showed ssh authentication working, but PAM authentication failing.

@jainyzau
Copy link

jainyzau commented May 3, 2019

@jainyzau thanks for the report.
Could you please advice what is the settings in .bashrc that interfere with the copy of the sources?
By the way, could you please switch to 'rsync' as source copy method, instead of "sftp"?
Thanks for your support!

@lukka Sorry for late reply. I missed the notifications. I'm now using 'rsync' to sync source code to Linux box, and it works great. One problem is that the 'rsync' shipped with VS2017 can't handle symbol links. We have several symbol links in git repo, when copying source code from Windows to Linux, these symbol links always block copying more files and thus can't build. A workaround is we can remove these symbol links in Windows, and create them later before building by configuring 'remotePrebuildCommand'.

@lukka
Copy link
Member

lukka commented May 14, 2019

@jainyzau thanks a lot for the feedback. Please create a ticket on Developer Community suggesting that we should deal properly with file system links. Thanks a lot for your support!

@jainyzau
Copy link

jainyzau commented Jul 2, 2019

@lukka Sorry for late reply. I have just created a ticket in Developer Community.
Can't Send Symbol Links to Linux in VS2017

@pdoykov
Copy link

pdoykov commented Dec 10, 2019

I had the same problem. It occurred that 'MaxSession' setting in the target Linux machine' sshd_config was set to 1. Setting it to 10 fixed the issue.

@lukka
Copy link
Member

lukka commented Jun 9, 2020

@pdoykov thanks for letting us know. You can always create a ticket or a suggestion on developercommunity to ask for support in case you need it, thanks!

@aaastanciu
Copy link

Has anyone been able to get this to work on YOCTO? I've attempted most answers above. I consistently get the same error in "devenv_exe_linux_correction_error":

liblinux.Ssh.Common.SshException: Channel was closed.
at liblinux.Ssh.SubsystemSession.WaitOnHandle(WaitHandle waitHandle, TimeSpan operationTimeout)
at liblinux.Ssh.Sftp.SftpSession.OnChannelOpen()
at liblinux.Ssh.SubsystemSession.Connect()
at liblinux.Ssh.SftpClient.OnConnected()
at liblinux.Ssh.BaseClient.Connect()
at liblinux.IO.RemoteFileSystemImpl.ConnectCore()
at liblinux.IO.RemoteFileSystemImpl.Connect(PasswordConnectionInfo passwordConnectionInfo)
at liblinux.IO.RemoteFileSystemImpl.Connect()
at liblinux.IO.RemoteFileSystemImpl.Connect(IRemoteSystemBare remoteSystem)
at liblinux.RemoteSystem.get_FileSystem()
at liblinux.DistributionId.GetSystemId(IRemoteSystem remoteSystem)
at liblinux.DistributionId.GetDistributionId(IRemoteSystem remoteSystem)
at liblinux.SystemProperties.Populate()
at liblinux.SystemProperties..ctor(IRemoteSystem remoteSystem)
at liblinux.UnixSystem.get_Properties()
at SSHConnectionUI.MainWindow.login_Click(Object sender, RoutedEventArgs e)

@matdug
Copy link

matdug commented Jul 27, 2021

Hi @aaastanciu,

Adding
IMAGE_FEATURES += "ssh-server-openssh"
and
IMAGE_INSTALL += "openssh-sftp-server"
in a recipe fixed the issue for me.

Tested with yocto Dunfell 3.1.9

@eng1n88r
Copy link

eng1n88r commented Apr 3, 2024

Just happened to have the same issue with Visual Studio 2022 and Azure Linux VM. Was able to ssh into it with everything but VS.

I checked the ssh logs on the server and noticed this:
userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms [preauth]

So updating the /etc/ssh/sshd_config with PubkeyAcceptedAlgorithms=+ssh-rsa solved the issue for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests