How can I regain SSH access to a remote server after changing AllowUsers?

2

I was in the process of upgrading my security standards. I added AllowUsers admin. Then I realized I had another account that needed SSH access for web development, so I changed the line to AllowUsers admin,other not realizing that the correct syntax would have been AllowUsers admin other. I now have no SSH access to my server and I have disabled root access.

The server is 3,000 miles away, I'm at college and I really don't want to have to walk my dad through extracting the hard drive, mounting it, and changing sshd_config. Is there any way I can fix this remotely? It is running an OpenVPN server which I can still connect to as well as HTTP(S) and VNC (which does not start at boot).

DontTurnAround

Posted 2016-02-18T01:08:51.840

Reputation: 187

1Walk your dad and guide him to start VNC. – techraf – 2016-02-18T01:33:41.963

It's headless, the only way to do that would be SSH. I suppose it could be possible to connect it to a display but that would involve either putting a monitor in that room which would be very difficult, or bringing the server out of the room which would also be difficult – DontTurnAround – 2016-02-18T01:35:54.533

Answers

2

Within the limits of the information you provided (ie no other way in), you are out of luck for doing it online.

Depending on your systems configuration if it will boot a pen drive (or CD?) in preference to the installed drives, you could create a system which creates a reverse SSH tunnel (ie to get through the firewall) over which you could then ssh into the pen-drive install, mount the real drive, modify the ssh config file. This is definitely no a trivial solution and hinges on the very questionable premise that the system will boot to USB first if its present.

davidgo

Posted 2016-02-18T01:08:51.840

Reputation: 49 152