how do I prevent the attacks on my linode
I have this linode which always get attacks when ever we change open (allow )some ports we need on the firewall
Look at fail2ban… It's not prevention, it's mitigation. You can try blacklisting but that consumes a lot of effort and resources and gets pretty unwieldy pretty quickly (trust me on this).
When you open ports in your firewall, you can dis-/allow groups of networks using ipset. You can add/delete entries from the ipset (thus changing the list of networks you dis-/allow) without resetting the firewall.
There's no foolproof way to prevent attacks on open ports except to keep the port closed.