I seem to be getting a lot of different connections (ssh) on this Ubuntu server I am sshed into. Are these just brute force attempts?
When running netstat -tnpa | grep 'ESTABLISHED.*sshd' why do I get at end of each line "root@p" and "[accep" respectively?
Furthermore, when running grep sshd.\*Failed /var/log/auth.log | tail -20 I seem to get a lot of different "invalid users". Why is that so?
Lastly, ps auxwww | grep sshd: outputs two "[accepted]". Why is that so?
Thank you
Update:
Another interesting thing happened now. I ran netstat -tnpa | grep 'ESTABLISHED.*sshd' again and an IP in the form "103.100.xxxx" from Hong Kong apparently was listed. I had then run cat /var/log/auth.log | tail -100 and gotten the following
Feb 16 17:58:25 838396123831 sshd[227710]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=103.100.210.xxx user=root
Feb 16 17:58:26 838396123831 sshd[227708]: Received disconnect from 103.136.xxxxp ort 33268:11: Bye Bye [preauth]
Feb 16 17:58:26 838396123831 sshd[227708]: Disconnected from invalid user hero 103.136.xxxx port 33268 [preauth]
Feb 16 17:58:27 838396123831 sshd[227710]: Failed password for root from 103.100.xxxx port 40810 ssh2
Feb 16 17:58:27 838396123831 sshd[227710]: Received disconnect from 103.100.xxxx port 40810:11: Bye Bye [preauth]
Feb 16 17:58:27 838396123831 sshd[227710]: Disconnected from authenticating user root 103.100.xxxx port 40810 [preauth]
Then I ran grep sshd.\*Failed /var/log/auth.log | tail -20 and spotted Feb 16 18:00:42 838396123831 sshd[227760]: Failed password for invalid user ircbot from 103.136.xxxxx port 47546 ssh2
I then run grep sshd.\*Failed /var/log/auth.log | tail -100 and see
Feb 16 17:53:24 838396123831 sshd[227596]: Failed password for root from 103.136.xxxx port 33470 ssh2
Feb 16 17:55:57 838396123831 sshd[227652]: Failed password for root from 103.136.xxxxx port 47406 ssh2
Feb 16 17:58:24 838396123831 sshd[227708]: Failed password for invalid user hero from 103.136.xxxxx port 33268 ssh2
Feb 16 18:00:42 838396123831 sshd[227760]: Failed password for invalid user ircbot from 103.136.xxxxx port 47546 ssh2
What does this mean? What is happening? Was or is any other person managed to log in to the server via ssh? "Last" command does not list any other Ip addresses except mine so...


netstat -tnpa | grep 'ESTABLISHED.*sshd'print more? What does the "root@p" and "[accep" for example mean? @Kusalananda – Yohan Feb 16 '21 at 18:28sshd, always, and it forks off asshdfor each established connection. If you have logged into this machine using SSH, then this is what I would expect to see. But I would leave it to some other Linux person to say for certiain that it looks ok (I'm not a Linux user, I run OpenBSD). – Kusalananda Feb 16 '21 at 18:33netstat -tnpa | grep 'ESTABLISHED.*sshd'show them? – Yohan Feb 16 '21 at 18:38pis actuallypts/0, see your 2nd screenshot. You can also see the full string[accepted]there. – Kusalananda Feb 16 '21 at 18:40sshdlets you know what each instance of itself is for. Thepts/0one is the one that accepts incoming connections. The[accepted]is asshdthat has accepted an incoming connection (started for this purpose by the first one). Can't say much more than that I'm afraid. I'm sure there are other answers on this site that mentions these. – Kusalananda Feb 16 '21 at 18:46pts/0, which is listening for connections. – Kusalananda Feb 16 '21 at 18:51man journalctl,sudo journalctl -b 0 $(type -p sshd)– waltinator Feb 16 '21 at 19:34sudo journalctl -b 0 $(type -p sshd)helpful though? What am I seeing? @waltinator I mean which question of mine are you answering by this – Yohan Feb 16 '21 at 20:08