I have a debian 8 box. It is a plesk server with 90+ websites.
It seems somebody access to my server and delete the user root. I go to /etc/passwd and the file is not owned by root:root is owned by hacker:root as hacker is an username of the person who probably do this.
I can´t write on /etc/passwd and there is no root:x:0:0:root:/root:/bin/bash line. I have this line:
hacker:fiMWeeeegx9rM:0:0:pwned:/root:/bin/bash
And now no root proccess are running, all proccess run under hacker name in the server.
Two questions:
1.- I think I can reboot the server to change the hacker user password but how I can undo the changes, restore root password and all proccess that run under hacek username run again under root name?
2.- The access to the server is only rsa key and IP. How it is possible this? If I fix it, how can I protect the box in the future?
Thanks