mlody.1039
New Member
Greetings.
Lots of users use SSH for their VPS/Dedicated Server and sometimes you can see people try access your SSH on Port 22 or try Crack it.
So here is 2 ways to protect from it.
First we can change our SSH Port lots of people just go to random IPs and try attack port 22 as it main Port of SSH.
So For Debian/Ubuntu/CentOs/Fedora
We do the follow commands
In CentOs to work you need Remove # before port
After we save the file
In Debian/Ubuntu we reset SSH with the follow command
After we disconnect from putty or ssh if you using Linux and we connect again with new port. old port 22 is no longer in use.
Second way is allow SSH only by your IP its only for people who have Static IP but you can still use it if your IP change all you do is Connect to VNC and update your new IP.
First we need to do is go to edit Allowed hosts
Now we need to edit host deny
Debian/Ubuntu
Hope this will help some people.
Best Regards
mlody.1039
Lots of users use SSH for their VPS/Dedicated Server and sometimes you can see people try access your SSH on Port 22 or try Crack it.
So here is 2 ways to protect from it.
First we can change our SSH Port lots of people just go to random IPs and try attack port 22 as it main Port of SSH.
So For Debian/Ubuntu/CentOs/Fedora
We do the follow commands
You will see Port 22 you can change it to any Number like 234vi /etc/ssh/sshd_config
In CentOs to work you need Remove # before port
After we save the file
In Debian/Ubuntu we reset SSH with the follow command
And In CentOs/Fedoraservice ssh restart
service sshd restart
After we disconnect from putty or ssh if you using Linux and we connect again with new port. old port 22 is no longer in use.
Second way is allow SSH only by your IP its only for people who have Static IP but you can still use it if your IP change all you do is Connect to VNC and update your new IP.
First we need to do is go to edit Allowed hosts
And add at the end of the file thisvi /etc/hosts.allow
If you want add more IPs all you do is sshd: [your IP],[another IP]sshd: [Your IP]
Now we need to edit host deny
And add the follow code at the endvi /etc/hosts.deny
Now we reset our SSHALL: ALL
Debian/Ubuntu
CentOs/Fedoraservice ssh restart
Now our SSH is fully protected so no one can connect to your Server only from the specific IP I also recommend change SSH Port at same time and use SSH IP Protection.service sshd restart
Hope this will help some people.
Best Regards
mlody.1039