I have a dedicated server with public IP address, opened port 22 and fail2ban running. I am using root account (I know it is wrong but I have to) and I have disabled logins with password. I am using an RSA 4096 bit key with key password (10 characters length with mixed letters, numbers and symbols).

Today checking the server and some logs, I saw on the screenshot below 2 Chinese IP addresses and my IP address from my office (for privacy reasons I have blanked my IP address)

netstat screenshot

using last command seems to be the only one that has logged in at system.

Do I have to worry? Are there any tips to better secure my server? (running Ubuntu server Xenial 16.04 LTS)


3 Answers 3


Anybody can establish a connection to the SSH server which means that this information does not say anything about a successful login. Restricting access to key based authentication only is a wise choice and will prevent the typical password brute force attacks. It will not prevent a simple connect to the SSH server though, but at this stage no real harm is done yet.

As for additional security settings please the the various questions about this topic on this site, like What methods are available for securing SSH?. There is no need to repeat everything here.

  • Am i safe? Do i have to setup anything else for improved security? any way to monitor access attempts? just saw the edited comment, thanks for the info!
    – harry
    Mar 31, 2020 at 11:18
  • 1
    @harry: Based on the information you've provided so far one cannot conclude a successful attack. As for additional information about hardening see my updated answer. Mar 31, 2020 at 11:23
  • @harry why not just check out the sshd log and grep for that IP? Moreover, there is not a hope that 4096bit RSA was brute forced. Unless your private key is compromised you are completely safe. (barring an SSH zero day).
    – Woodstock
    Mar 31, 2020 at 11:51

A ESTABLISHED connection on port 22 only means a TCP connection was made, not that a SSH session is active. If you telnet from your office computer to your server on port 22, and not type anything, you will see the Connection Established on netstat. And now that you masked your office and attacker IP's but not your own, expect more people connecting to it.

If you look on your logs, you will very likely see a login failure or a "client disconnected" messages with that Chinese IPs.

  • My IP is dynamic, that's why i don't bother mask it. :) thanks for the info!
    – harry
    Apr 3, 2020 at 22:52

This question is not necessarily a duplicate, but there is an interesting discussion around this question that may give some insight as to why you saw Chinese IP addresses connecting.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .