So today my Server got hacked. But just a non sudoer user.
Nov 26 10:44:18 Ubuntu-1604-xenial-64-minimal sshd[27188]: Accepted publickey for ... from hackerIP port 26394 ssh2: RSA SHA256:...
He started a screen and scanned networks nothing more. History is empty. He connected with some publickey tho I never added any keys. I know I should use ssh-keys instead of password. But my root never got compromised. What I noticed in auth.log is this
Nov 26 19:01:01 Ubuntu-1604-xenial-64-minimal CRON[12360]: pam_unix(cron:session): session opened for user ... by (uid=0)
Nov 26 19:01:01 Ubuntu-1604-xenial-64-minimal CRON[12360]: pam_unix(cron:session): session closed for user ...
Nov 26 19:02:01 Ubuntu-1604-xenial-64-minimal CRON[12368]: pam_unix(cron:session): session opened for user ... by (uid=0)
Nov 26 19:02:01 Ubuntu-1604-xenial-64-minimal CRON[12368]: pam_unix(cron:session): session closed for user ...
I do not know if I am posting it in the wrong section to be honest. I basically just want to know where to find the ssh-keys because my key folder is empty. How to disable remote login for that specific user (so that I only can connect over root and use 'su' command to login). And what to do with pam_unix.
Edit: Firtsly thanks for the huge help. I could undone everything the attacker did. And I disabled ssh-key login in sshd config so only passwords are valid. Failed2Ban is running as well and I am managing auth.log everyday manually.