I've changed the ssh port (just in case), now I was thinking to close port 22, to block immediately with ufw anyone trying to do damage on my server...
But when i initially enabled ssh i enabled a profile called OpenSSH, and i got the doubt it can do other things too. with this:
sudo ufw allow ssh
For example my vps can be accessed with vnc from provider control panel, if i close port 22 i risk to block vnc too? Or do other damage?
And how should i do it now?
sudo ufw deny ssh
sudo ufw deny OpenSSH
sudo ufw deny 22/tcp
First of all, VNC doesn't run of port
22
, but from ports5500
,5800
,5900
(by default), so you're fineYou mention a provider's VNC connection, but that connection doesn't make any communication to your server, at all, what you're seeing on your screen during those sessions is the monitor output from your machine and what you're sending is only literal keys and mouse input.
So, you can close those ports without fear of bricking that function