Accidentally replaced in .ssh root, unable to connect to server.

June 22, 2017 174 views
DigitalOcean Backups Ubuntu 16.04

Hi all,

I was shifting some files under SFTP in .ssh and I had accidentally replaced the in the server with my Mac Pro's Now I cannot connect to my server via ssh and console!

I have tried running the image backup but it does not seem to do any changes in regards to server settings.

What should I do? I have two sites hosted there and both are down.

3 Answers
SporkWitch June 22, 2017
Accepted Answer

The file on the server is '~/.ssh/authorizedkeys'; you put your in this (typically a server wouldn't even _have an on it, at least not for a user account).

Console access from the DO web interface is a local terminal, so you would need to use local authentication. If you did not set a passphrase (if you preloaded your keys when creating it, there is no password set, password auth is disabled), then you would not be able to get in. There should be an option in the web interface to reset the root password; attempt this, then login via console using that password. Change that password, fix your settings, and you should be good to go.

  • Stupid autoformatting, haha. The files above should be:


Why can't you connect via SSH and console? server-side has nothing to do with that.

I am not sure - I had run mysqlsecureinstallation before that too. After that, it keeps displaying this error : packetwritewait: Connection to port 22: Broken pipe

Have another answer? Share your knowledge.