Question

Can't connect via SFTP / SSH

Posted March 20, 2018 3.4k views
DigitalOceanUbuntu 16.04

Hi there,

I have a droplet configured with Ubuntu. It contains a Wordpress Installation (mysql, phpmyadmin).

I was able to connect via SSH / SFTP. Suddenly one day I was going to update some files in production and I was unable to connect via SFTP and SSH. It just closes my connection, even via Access Console from Digital Ocean Panel.
I didn’t change configs or updated any root system file. I’ve tried with support but can’t get a decent question on how get this to work.

I’ve made a reset of the root password but as soon as I set my new password but as soon as I set my password.. it happens again and i get instantly “kicked” out of the server.

I’ve tried to check if it was a network problem but it happens in different networks.

Any suggestions on how to get this to work again?

SFTP Error: Error: Received unexpected end-of-file from SFTP server
SSH: Connection to ********** closed.

Thanks

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.

×
2 answers

Something to try when logging in via ssh since you mention you login using a password is to disable your ssh-agent - killall ssh-agent

Once this is complete try logging in again. If you are successful, then what is happening is your shell’s key agent has to many keys loaded. When you try and log into your server the agent tries those keys first which cause the login to fail.

If this does not turn out and the droplet is indeed compromised, you can use recovery mode to attempt to restore it or at the very least attempt to grab data from the droplet.

https://www.digitalocean.com/community/tutorials/recovering-files-from-a-compromised-droplet-using-the-recovery-iso

The fact that the resetting the password from Access Console is giving you the same result leads me to believe that your droplet may be compromised. Possibly due to the Wordpress, mysql, phpmyadmin, if they weren’t secured.

I would suggest spinning up a new droplet and see if the problem remains. If not, you know its an issue with the droplet in question.

Hopefully you don’t have any data that isn’t backed up on the droplet that you can’t access.

Submit an Answer