Answer the question
In order to leave comments, you need to log in
How to restore ssh access Ubuntu?
I edited the sshd_config and ssh_config files, I wanted to allow the user to log in under ssh. After saving the config, restarted ssh. I can no longer log in not under the root or under the user, under the root it just does not accept the password, under the user it logs in and immediately the connection is closed.
Ruth knows the password and I did not forget it, I enter exactly the right one. Something screwed up in the config. Now how can I return everything back while leaving all the server data? The web server is working, I can access sites.
The hoster cannot help in any way, it only offers the option of reinstalling the system image.
Answer the question
In order to leave comments, you need to log in
Boot via IP-KVM or IPMI for a physical server, or a hypervisor if it is a virtual machine and edit the config from the "local" console. In general, in case of editing ssh remotely, you should always have a fallback option, as the simplest - a script in the screen that will return the working config to its place if it is not closed within 5 minutes or simply not logged out with one of the terminals, but check availability from another window. Kick the lazy hoster, he knows what to do, but he is too lazy.
Boot into single mode and say:
dpkg --force-confmiss -i /var/cache/apt/archives/openssh-server
If then vds, then you can fix the config back through the file manager control panel, it worked for me, though only through the panel of vdsmanager itself from isp
Reset iptables ( iptables -F )
Probably enabled by UFW firewall
Add ssh connection rule ( sudo ufw allow ssh )
And port if you haven't changed it. ( sudo ufw allow 22/tcp )
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question