SSH (secure shell) should be open to allow you to login to your server. You can set up passwordless login which requires you to have a cryptographic key which you store on your laptop in this case. This prevents others trying passwords on the SSH port. The port is also rate limited by fail2ban if I remember correctly.
This is all assuming the server is remote, eg a VPS.
Note that if you are using IPv6, the “security through obscurity” practice of assigning SSH to a different port is no longer a valid tactic, as anyone can get a quadrillion IPv6 addresses basically for free and you only have 65,535 ports. It’s one of many reasons not to use IPv6 unless you have some very specific reason to do so.
Also, the bad guys can ping your server over time and track which ports you have open. It is a simple script requiring almost no resources that can run in-between other jobs.
While this is indeed very true, in practice it is irrelevant. The ‘bad guys’ are looking for the low hanging fruit and if port 22 is closed will just move on rather than port scanning. It is not worth the effort in most cases.
Centos OS will report exactly how many brute force attempts are made between shell logins when you log in each time. On the default port 22 that number is usually in the hundreds or thousands of attempts, while on a system that the default ssh port has been changed it will be a handful, if any at all.
It is a cat-and-mouse game. As the older scripts assigned to specific sports stop being successful, newer scripts cataloging port usage will become more popular and the older scripts will be modified to check IP addresses based on the catalog.