Cannot connect with SSH from some of my computers on the local network

Hello,

I have configured ssh public key access from several computers on my local network and it works although just for the one of them. For the others connection times out. All of the computers are behind consumer grade router/access point.

Verbose output from ssh for one of the computers failing to connect is:

ssh root@<my_domain> -p 2222 -vvv
OpenSSH_8.7p1, OpenSSL 1.1.1l  24 Aug 2021
debug1: Reading configuration data /etc/ssh/ssh_config
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/user/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/user/.ssh/known_hosts2'
debug2: resolving "<edited>" port 2222
debug3: ssh_connect_direct: entering
debug1: Connecting to <edited> port 2222.
debug3: set_sock_tos: set socket 3 IP_TOS 0x48

That's the point where connection gets stuck and eventually times out.

  • Computer that connects successfully runs Ubuntu 18.04

  • Computers that fail run Arch Linux 5.13 and Centos 7

  • I can ping successfully the target Linode host from all of the computers that I try to connect with SSH

  • There is no trace of Linode host rejecting ssh connections in the logs

I run out of ideas how else I could debug it. Can you please advice on this?

Thanks

3 Replies

Computers that fail run Arch Linux 5.13 and Centos 7

Make sure these systems:

  • are running sshd(8); and
  • allow OUTBOUND ssh(1) connections in their firewalls.

-- sw

Thanks for the answer @stevewi - sshd was running and ssh connections were allowed. I looked into sshd status with systemctl status sshd on one of the Centos machines and it turns out there was following warning: UsePAM no is not supported and may cause problems - I have commented out UsePAM no line in the /etc/ssh/sshd_config and ssh connection with Linode machine started working.

There wasn't such warning on Arch Linux and this one still cannot connect to the Linode (also running Centos 7), even though it has no problems connecting to the other Centos 7 machines in my local network.

There wasn't such warning on Arch Linux and this one still cannot connect to the Linode (also running Centos 7), even though it has no problems connecting to the other Centos 7 machines in my local network.

I doubt that it's distro/version related… The Linode is not on your local network. I would begin with that lead to start tracking things down.

-- sw

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct