Ssh client issue / general outbound traffic issue?

SSH client seems not work. I can’t ssh from the OSMC to any external machine. After you type the password and hit enter it gets frozen.

Can you help?

Try this:

ssh osmc@localhost

Does it freeze?

No, for localhost connections it is fine. For remote, it freezes.

And here is the debug logs:

XXXX@XXXX’s password:
debug2: we sent a password packet, wait for reply
debug1: Authentication succeeded (password).
Authenticated to XXXX ([XXXX]:22).
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug1: Entering interactive session.
debug2: callback start
debug2: fd 3 setting TCP_NODELAY
debug3: packet_set_tos: set IP_TOS 0x10
debug2: client_session2_setup: id 0
debug2: channel 0: request pty-req confirm 1
debug1: Sending environment.
debug1: Sending env LC_PAPER = pl_PL.UTF-8
debug2: channel 0: request env confirm 0
debug3: Ignored env XDG_SESSION_ID
debug1: Sending env LC_ADDRESS = pl_PL.UTF-8
debug2: channel 0: request env confirm 0
debug1: Sending env LC_MONETARY = pl_PL.UTF-8
debug2: channel 0: request env confirm 0
debug3: Ignored env TERM
debug3: Ignored env SHELL
debug3: Ignored env SSH_CLIENT
debug1: Sending env LC_NUMERIC = pl_PL.UTF-8
debug2: channel 0: request env confirm 0
debug3: Ignored env SSH_TTY
debug3: Ignored env RPI_UPDATE_UNSUPPORTED
debug3: Ignored env USER
debug3: Ignored env LS_COLORS
debug1: Sending env LC_TELEPHONE = pl_PL.UTF-8
debug2: channel 0: request env confirm 0
debug3: Ignored env MAIL
debug3: Ignored env PATH
debug1: Sending env LC_IDENTIFICATION = pl_PL.UTF-8
debug2: channel 0: request env confirm 0
debug3: Ignored env PWD
debug1: Sending env LANG = en_US.UTF-8
debug2: channel 0: request env confirm 0
debug1: Sending env LC_MEASUREMENT = pl_PL.UTF-8
debug2: channel 0: request env confirm 0
debug3: Ignored env SHLVL
debug3: Ignored env HOME
debug3: Ignored env LOGNAME
debug3: Ignored env SSH_CONNECTION
debug3: Ignored env XDG_RUNTIME_DIR
debug1: Sending env LC_TIME = pl_PL.UTF-8
debug2: channel 0: request env confirm 0
debug1: Sending env LC_NAME = pl_PL.UTF-8
debug2: channel 0: request env confirm 0
debug3: Ignored env _
debug2: channel 0: request shell confirm 1
debug2: callback done
debug2: channel 0: open confirm rwindow 2621440 rmax 262144

//update

I think that it is a general outbound issue. It acts exactly the same when I try to connect to e.g. google.com.

root@osmc:~# telnet google.com 443
Trying 172.217.20.174…

root@osmc:~# ping google.com
PING google.com (172.217.20.174): 56 data bytes
64 bytes from 172.217.20.174: seq=0 ttl=53 time=23.886 ms
64 bytes from 172.217.20.174: seq=1 ttl=53 time=23.684 ms
64 bytes from 172.217.20.174: seq=2 ttl=53 time=19.295 ms

There is not firewall.

Hi,

I’ve been testing this and have been unable to reproduce.

I’ve done some googling and the only thing I can come up with is: If you router has an option called nat boost or acceleration, try disabling this option.

Failing this I would try restarting your router and/or any switches between your pi and router.

Thanks Tom.

In your first post you said:

I can’t ssh from the OSMC to any external machine

Which external machines are you trying to SSH to? Are they in your local network and under your control?

This is really strange.

Look here:

root@osmc:~# apt-get install tcpdump
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following NEW packages will be installed:
tcpdump
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 400 kB of archives.
After this operation, 859 kB of additional disk space will be used.
Get:1 http://security.debian.org/ jessie/updates/main tcpdump armhf 4.9.2-1~deb8u1 [400 kB]
Fetched 400 kB in 0s (1004 kB/s)
Selecting previously unselected package tcpdump.
(Reading database … 24637 files and directories currently installed.)
Preparing to unpack …/tcpdump_4.9.2-1~deb8u1_armhf.deb …
Unpacking tcpdump (4.9.2-1~deb8u1) …
Setting up tcpdump (4.9.2-1~deb8u1) …

It successfully installed the package from the http://security.debian.org but when I try to connect to the same host and port via telnet I cannot do it. Why? :slight_smile:

root@osmc:~# telnet security.debian.org 80
Trying 195.20.242.89…

Hi,

Is this issue only occurring on your pi or are able to reproduce on any other devices on your network?

Also as Dilthedog has asked are you trying to ssh to devices on your lan or wan?

Have you checked your router and switches on your network?

Thanks Tom.

Just on the PI. I have another 3 linux machines on the same network and the issue is ONLY on the PI.

Just tested and:
-I can ssh to another machine in the local network but…
-I can’t ssh to the router which is also on the same network :expressionless:
-I can’t ssh to the devices that are outside the local network but…
-I can ping them.

I don’t have SSH problem with other devices on my local network.

I suspected MTU issue on the wlan interface, changed that from 1500 to 1400 but did not solve the problem. No idea what is happening here. It is the fresh installation.

Hi,

How does your pi connect to your router, wifi or wired?

If wired is directly wired or through a switch, or network over mains plugs?

Thanks Tom.

It is connected over wlan and additional tests confirmed that this is wlan related issue.

I have no idea why, I have no problem with other Debian/Ubuntu systems that are located on the same wireless network.

My router is Mikrotik.

What is also weird is that Kodi and other programs (e.g. apt-get) can connect to external resources but when you try to do the same directly from the bash then you cannot. Strange. Never seen such behavior.

Perhaps because you shouldn’t be telneting to security.debian.org at all, let alone on port 80 (http).

You can SSH to osmc@localhost, so SSH seems to be working on OSMC.

You can also SSH to another machine on your local network. So SSH is working across your LAN and on the other local machine (sshd).

You cannot SSH to your router. I’ll take a guess that the router is not up to date with its SSH software and/or configuration and only uses some cipher/protocol that is incompatible with SSH on OSMC. What’s the “other” linux box you can SSH to, and can you SSH

  • from it to OSMC; and
  • from it to the router?

SSH-ing to other devices outside the local network is only a valid test if you control them and you can logon to them from the other Linux box(es) on your LAN.

Why? Telnet is a basic tool to check end-to-end connectivity. security.debian.org is just an example.

I agree.

I agree.

The same thing. Don’t go that road. ssh is just an example. You can’t connect to any external resources via telnet.

My router is up to date. I can ssh to it from my Ubuntu 16.04, Debian 9 and Win10.

I’m almost out of time for today.

Can you run wget google.com ? If it successfully downloads index.html, you have working DNS and the external network is probably working ok. Beyond that, you’ll need to provide a more specific definition of the issue.

I can’t speculate on your router connection problem since I have zero information about it.

osmc@osmc:~$ wget google.com

Connecting to www.google.pl (www.google.pl)|172.217.20.163|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: unspecified [text/html]
Saving to: ‘index.html.1’
index.html.1 [ <=> ] 10.93K --.-KB/s in 0s
2017-10-28 13:34:37 (38.9 MB/s) - ‘index.html.1’ saved [11192]

=====

osmc@osmc:~$ telnet google.com 80
Trying 172.217.20.174…

=====

I will run raspbian on same PI and on the same wifi network and I will check if the issue is there or not. Will provide the feedback in 15 minutes.

There is exactly the same behavior with the Raspbian. It seems that the problem sits somewhere between PI and Mikrotik. Strange.

Any idea?

That was a useful test.

If the Pi is using wifi, try with a cable connection to the router. Also make sure QoS is switched off on the router.

Unfortunately, I’m out of time for today.

Hi,

This may help:

https://expresshosting.net/ssh-hanging-authentication/

Thanks Tom.