"Get SSH command" cmd not working, but "Open Terminal in browser" opens a valid SSH session

When Selecting “Open Terminal in Browser”, a new tab opens where I am able to enter the username and password as expected.

However, when trying to SSH to the same device from terminal, I get the following error (tried on Windows and Ubuntu clients) ssh_exchange_identification: Connection closed by remote host. When adding -vvv for a more detailed log, I get the following

$ ssh -p xyzxyz -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no experience.aikaan.io -l xyzxyz -vvv
OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n  7 Dec 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "experience.aikaan.io" port xyzxyz
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to experience.aikaan.io [xyzxyz] port xyzxyz.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/xyzxyz/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/xyzxyz/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/xyzxyz/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/xyzxyz/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/xyzxyz/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/xyzxyz/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/xyzxyz/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/xyzxyz/.ssh/id_ed25519-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3
ssh_exchange_identification: Connection closed by remote host

Any suggestions as to what could be causing this?

Hi @nikhil,

Can you elaborate a bit on this ? May be a terminal screen shot might help?

Does this happen with any of the devices or a specific device? If you see this problem for a specific device, we can run the sshd on that device in the foreground and check the errors [assuming the device is local and you can access it].

The “connection closed by remote” is a generic error,
a. Due to a permission issue on the edge device [look at /etc/hosts.allow, also try adding the field “sshd: ALL” to “/etc/hosts.allow” file on the edge device]
b. Resource availability on device, specifically if there is no memory -page to allocate for new connection

Do you see this problem for all the devices ? Then the issue may be in the AiKaan controller. If this is the case, we can debug further with AiKaan engineers.

Thanks
C

Hey

We figured out the issue. Upon trying to inspect the sshd logs, we noticed there were none, and then realised openssh-server was not even installed. Installing it fixed the issue, and we are able to ssh through a terminal now.

It raised an interesting question though, of how were we able to access the machine through the browser without ssh server installed. Any thoughts on this?

Here’s a screenshot of it working through the browser

Hi @nikhil

Good that you found the issue.

that is our engineer’s expertise :wink:

Essentially, we play around the tunnels and open up TTY session for you. Be assured, all these tunnels are as secure as SSH sessions. No compromise on security, while providing flexibility

Thanks
C

Nice, thanks for the assistance!