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

Posted June 22, 2017 3.8k views
DigitalOceanBackupsUbuntu 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.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
3 answers

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.

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