I enabled google 2 factor authentication for my server, but it started acting weirdly and I am locked out. I have access to VNC, but my password has a special symbol @
and I am unable to input that via VNC. I am locked out.
Asked
Active
Viewed 268 times
0

Sibidharan
- 135
- 5
-
Reboot the server single-user and brute-force the password? – MadHatter Sep 10 '16 at 11:46
-
That is the problem. If I reboot, the VNC wakes up only at login screen!! I am unable to access the GRUB now.. :( – Sibidharan Sep 10 '16 at 11:47
-
Is this a virtual or a physical server? – MadHatter Sep 10 '16 at 11:50
-
@MadHatter Virtual – Sibidharan Sep 10 '16 at 11:51
-
You don't say what virtualisation technology it is. Are you sure it's a proper virtual server, or is it just a container? If it is a real VPS, you need to work with the vritualisation provider to find out why you can't get "remote console" access at the GRUB phase. – MadHatter Sep 10 '16 at 11:51
-
I am getting the VNC login screen.. But the issue is my password has @ in it which I am unable to input via VNC. – Sibidharan Sep 10 '16 at 11:51
-
Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/45187/discussion-between-madhatter-and-sibidharan). – MadHatter Sep 10 '16 at 11:52
-
@MadHatter It is a VPS. Virtual Private Server – Sibidharan Sep 10 '16 at 11:52
-
Glad we could fix it, Sibidharan. By the way, did you zero out root's password, or replace it with a known hash? (Just so I can get the answer precise.) – MadHatter Sep 10 '16 at 14:20
-
@MadHatter I zeroed it out and set a new password using `passwd` – Sibidharan Sep 10 '16 at 14:20
1 Answers
1
As the chat log may or may not still show, the underlying problem was that non-alphanumeric characters weren't being correctly transmitted by the VNC-based virtual console, so there was no way to type an @
character. The solution was booting the VPS off rescue media, using UpCloud's interface for booting from virtual media, and zeroing out the root password from the /etc/shadow
file.

MadHatter
- 79,770
- 20
- 184
- 232