Home >System Tutorial >LINUX >Problems and solutions to the problem that SSH cannot connect when installing Ubuntu 22.04

Problems and solutions to the problem that SSH cannot connect when installing Ubuntu 22.04

王林
王林forward
2024-02-29 10:58:211017browse

php editor Banana discovered that the problem of being unable to connect after installing SSH in Ubuntu 22.04 has been bothering many users. In daily use, SSH connection is very important, so it is particularly critical to solve this problem in time. This article will introduce in detail the common reasons why SSH cannot connect when installing Ubuntu 22.04, and provide solutions to help you solve this problem smoothly.

1. Modify ssh configuration file

vim /etc/ssh/sshd_config

Turn on the PermitRootLogin annotation and change the value to yes

Problems and solutions to the problem that SSH cannot connect when installing Ubuntu 22.04

Save changes and exit

:wq

2. Restart the ssh service

sudo service ssh restart

3. Reopen the ssh client and connect. If you use an ssh client that has been opened before modifying the configuration, you cannot use the new ssh configuration.

Preset settings:

The above is the detailed content of Problems and solutions to the problem that SSH cannot connect when installing Ubuntu 22.04. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:jb51.net. If there is any infringement, please contact admin@php.cn delete