Answer the question
In order to leave comments, you need to log in
How to open port 22 on Ubuntu?
Good afternoon,
Do not judge strictly for the question, there is not much experience with Ubuntu.
Given - after updating Ubuntu to version 20.04.1 c 16, and initially from 14, I can’t connect to the server through port 22, everything worked fine before the update. Connected via the web console, which limits the readability of some commands. I check through the
Code sudo iptables - L
, it gives out a mountain of unreadable information, in which I can’t even find port 22. It was not possible to open
through , although it shows ALLOW from Anywhere. It also failed to open
through , ping.eu shows that port 22 is closed, and it can not be opened in any way. When connecting to the server - The connection was interrupted. shows that only ports 80 and 443 are open.sudo ufw allow ssh
sudo ufw status
sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT
sudo nmap localhost
Can someone give advice on what to do?
Thanks Andrey
Answer the question
In order to leave comments, you need to log in
Based on the comments - your port is not closed, and the ssh server has not started.
Hard reinstallation of openssh-server forcing rewriting of configs to default ones
sudo mv /etc/ssh /etc/ssh_backup
sudo apt install --reinstall -o Dpkg::Options::="--force-confask,confnew,confmiss" openssh-server
sudo service sshd restart
Judging by the screenshot from the comment, you just don’t have an SSH server running, the firewall has nothing to do with it, we disagree. Well, in general - it would be strange if some updates destroyed access via SSH.
Nail the configs and reinstall the service, most likely it will help.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question