0

I recently made my own VPN Server (OpenVPN) on my Linux Debian vServer. Now, in order to make it more secure I figured it would be a good idea to add 2-Factor-Authentication. So installed Google Authenticator using this tutorial: https://ubuntu.com/tutorials/configure-ssh-2fa#2-installing-and-configuring-required-packages

Everything went well until I got to the step where you are supposed to edit the ssh_config in /etc/ssh/. After opening the config I couldn't find any line saying something like 'ChallengeResponseAuthentication', so I simply added it. After saving, my SSH Client (Termius) crashed and I got logged out. Now my main Problem is I don't know how to log back in. I changed my Root Password once but I dont know if I changed it correctly (from what Ive noted). So now I got 3 possible Passwords: The old standart Root Password, One new Root Password (which I changed via the 'passwd' command in the SSh-Client and lastly the Root Password I changed via the Web Interface of the vServer. None of them work. Of course I also tried logging in via Authentication code on my phone but that didn't work either. It would be nice to know how to log back onto my server even though all systems (Mailserver and VPN-Server) are still working normally.

Some Data that might be useful: Linux Version: Linux Debian 9.5.0 Minimal

Status Online Type kvm Nodename vnode003 Hostname v1613952.v-server.me

Hosted by Avoro.eu Bandwidth 11.66 GB of 5 TB Used / 4.99 TB Free Also keep in mind that I cant access the server at all (at least as far as I am aware of)

Best regards.

15
  • 1
    You need a remote console access. If not available in your offer you need to boot with a rescue/live image and change settings from there. Your web interface might offer other options, but I can't know this. You should ask your provider if a remote console access is possible. – A.B Nov 5 '20 at 11:35
  • I already figured out how to boot it in kernel rescue mode, but I have no remote access. What are the commands to permit sudo commands (so I can uninstall the authenticator)? – Zinio Nov 5 '20 at 12:14
  • Never mind. If whatever boots can't be reached with a console, I don't see what can be done – A.B Nov 5 '20 at 12:18
  • Is there no way to use sudo commands when in rescue mode? Because this way I can access the server even with no passwd. Now I Just need to uninstall the authenticator and reset my root password. But in order to do that I have to enter 'sudo apt-get remove libpam-google-authenticator' which is not working. – Zinio Nov 5 '20 at 12:18
  • Please add in your question how you get access from remote without ssh. From the comments it's not clear to me. – A.B Nov 5 '20 at 12:19
0

Finally found a possible solution. Got remote access via the noVNC-Console and uninstalled Google Authenticator from there. Remember to also revert the changes you have made to the sshd_config.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.