Score:-1

ssh doesn't work with XUbuntu 22.04

cn flag

(related: Ubuntu 22.04 SSH the RSA key isn't working since upgrading from 20.04 / SSH and Telnet timing out. Ubuntu 22.04 lts but the solution provided doesn't work)

Hi all,

ssh works from home. I can ssh to my laboratory, push to github.com+ssh, etc...

Nevertheless, I installed XUbuntu-22.04 on a new computer and ssh doesn't work for this machine.

After reading Ubuntu 22.04 SSH the RSA key isn't working since upgrading from 20.04 , I added HostKeyAlgorithms +ssh-rsa and PubkeyAcceptedKeyTypes +ssh-rsa to ~/.ssh/config and /etc/ssh/sshd_config , restarted ssh sudo systemctl restart sshd.service but it still doesn't work (see below).

I don't know much things about ssh so I have no clear idea of what I'm doing.

Here are a few outputs:

$ openssl version
OpenSSL 3.0.2 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022)

$ lsb_release  -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.1 LTS
Release:    22.04
Codename:   jammy

$ cat .ssh/config 

Host my.host
    PubkeyAcceptedKeyTypes +ssh-rsa
    KexAlgorithms +diffie-hellman-group14-sha1
    HostKeyAlgorithms +ssh-rsa

$ tail /etc/ssh/sshd_config
HostKeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa


$ sudo systemctl restart sshd.service


 ssh -vvvv -X me@my.host
OpenSSH_8.9p1 Ubuntu-3, OpenSSL 3.0.2 15 Mar 2022
debug1: Reading configuration data /home/me/.ssh/config
debug1: /home/me/.ssh/config line 8: Applying options for my.host
debug3: kex names ok: [diffie-hellman-group14-sha1]
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/me/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/me/.ssh/known_hosts2'
debug2: resolving "my.host" port 22
debug3: resolve_host: lookup my.host:22
debug3: ssh_connect_direct: entering
debug1: Connecting to my.host [IP] port 22.
debug3: set_sock_tos: set socket 3 IP_TOS 0x10
debug1: connect to address IP port 22: Connection timed out
ssh: connect to host my.host port 22: Connection timed out

what am I missing ?

EDIT

I also tried too add the values in sshd_config + ssh_config.

Telnet doesn't work too.

$ telnet my.host 22 
Trying IP...
telnet: Unable to connect to remote host: Connection timed out
Pierre avatar
cn flag
@user68186 yes <br/>$ ssh 127.0.01<br/> The authenticity of host '127.0.0.1 (127.0.0.1)' can't be established.<br/> ED25519 key fingerprint is <br/>SHA256:.<br/> This key is not known by any other names<br/> Are you sure you want to continue connecting (yes/no/[fingerprint])? yes<br/> Warning: Permanently added '127.0.0.1' (ED25519) to the list of known hosts.<br/> me@127.0.0.1's password: <br/> <br/>
Pierre avatar
cn flag
"I installed XUbuntu-22.04 on a new computer and ssh doesn't work for this machine." I mean: I can do ssh on another machine (with an older ubuntu), but on this new machine with the newest xubuntu I got the problem described above.
Pierre avatar
cn flag
@user68186 "So you do you mean to say you can't ssh from this machine" yes that's what I meant.
Pierre avatar
cn flag
I'm closing this and I'll re-ask in a different way. After exploring the problem it's not a problem about ssh but I just cannot ping anything on port 22.
ar flag
Please delete the question.
Score:0
cn flag

OK I got the solution : the connection was forbidden by the internet box ( But I don't understand why I got internet... )

Try something else:

$ mtr -bTwn -P 80 -Z 1 185.233.100.113
Start: 2022-11-26T15:00:26+0100
HOST: okazaki         Loss%   Snt   Last   Avg  Best  Wrst StDev
  1.|-- 192.168.1.1      0.0%    10    1.5   1.2   0.9   1.7   0.2
  2.|-- ???             100.0    10    0.0   0.0   0.0   0.0   0.0
  3.|-- ???             100.0    10    0.0   0.0   0.0   0.0   0.0
  4.|-- 80.12.192.158    0.0%    10    5.8   6.2   2.5  21.6   6.2
  5.|-- 193.252.162.250  0.0%    10    9.9   9.9   9.5  10.4   0.3
  6.|-- 81.253.129.186   0.0%    10   10.5  10.4  10.1  10.7   0.2
  7.|-- 193.252.137.74   0.0%    10   10.2  20.3  10.0 110.8  31.8
  8.|-- 193.251.131.8    0.0%    10   10.7  10.7  10.1  11.0   0.3
  9.|-- 81.52.188.22     0.0%    10   10.9  10.5  10.0  11.3   0.4
 10.|-- 78.153.231.227   0.0%    10   18.6  18.3  17.4  18.9   0.4
 11.|-- 31.172.233.174   0.0%    10   17.7  18.0  17.1  22.4   1.6
 12.|-- 5.83.232.2       0.0%    10   17.8  17.9  17.7  18.6   0.3
 13.|-- 149.6.44.18      0.0%    10   18.4  18.7  17.9  22.8   1.5
 14.|-- 185.233.100.113  0.0%    10   19.0  18.6  18.1  19.0   0.3

$ mtr -bTwn -P 22 -Z 1 185.233.100.113
Start: 2022-11-26T15:00:50+0100
HOST: okazaki     Loss%   Snt   Last   Avg  Best  Wrst StDev
  1.|-- 192.168.1.1  0.0%    10    0.6   0.7   0.5   1.0   0.2
  2.|-- ???         100.0    10    0.0   0.0   0.0   0.0   0.0
Score:0
ug flag
telnet: Unable to connect to remote host: Connection timed out

This error means that the connection can not be established between your local and remote server. You can use some tool to double check if you can connect to the port on remote server.

If that is the case, you should check it from your connection level first. The ssh key/password exchanges hasn't started yet.

If you can ssh to my.host from another server, that means the sshd service running on my.host is good. You should check it from network layer to see why this server can't connect to it.

It might be related to network firewall or network ACL. Those are the rules which defines the client ip address which can access the server. The cloud provider like AWS also has this feature.

You can continue only after this connection issue is fixed.

andrew.46 avatar
in flag
SE spam filter triggered on the domain you have linked to so that link has been removed...
aiziyou avatar
ug flag
@pierre if you think this answer is helpful for your question. please accept it.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.