arrow_upward

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to change SSH port in VPS
#1
Hello Folks. Last time I went to login to my VPS but I found a very weird thing, check the ping below.

[Image: 1505290836.png]

So someone was brute forcing my VPS and as you can see 22082 failed login so you have to take an action and do something before accessing your VPS so I found the solution for this and that solution was Changing SSH Port and that's going to be our tutorial for today.

So firstly you have to install nano using this command

On Ubuntu

sudo apt-get install nano


On CentOS and Fedora

sudo yum install nano


Then we have to type this command to edit the SSH settings [Works for all Linux Distributions]
nano /etc/ssh/sshd_config

Then you will find

#Port 22


You have to uncomment it and change the port, for example it's going to be like that

Port 55


Now save your changes and now we are done, last command we have to execute only to restart the SSH service.

Use this command if you are using Ubuntu

service ssh reload


And use this command if you are using CentOS or any Redhat Distribution

sudo systemctl restart sshd


Now we are done. Your connection will not be disconnected but next time you wanna to connect you have to put the port you chose in the port box (for me it was 55) like that
[Image: 1505293072.png]

And if you are using Linux so you have to type

ssh root@MyVPSIP -p 55
root = The VPS User
MyVPSIP = The IP of your VPS
-p = Means to use specific port
55 = Is the port I chose

The whole command means to connect to my VPS using a user called root in this IP and use specific port which it's 55.

That was our small tutorial for today, it seems too tall but it's so easy also I advise you to change the VPS port for not getting brute force or attacks on this port.
Thank you for reading my small tutorial, I hope you benefited from it and goodbye. Angel


Messages In This Thread
How to change SSH port in VPS - by AmirGT - 09-13-2017, 09:04 AM
RE: How to change SSH port in VPS - by Liquidips - 09-13-2017, 11:38 AM
RE: How to change SSH port in VPS - by AmirGT - 09-13-2017, 03:03 PM
RE: How to change SSH port in VPS - by sagher - 09-14-2017, 04:16 AM
RE: How to change SSH port in VPS - by AmirGT - 09-14-2017, 09:01 AM
RE: How to change SSH port in VPS - by sagher - 09-14-2017, 11:42 AM
RE: How to change SSH port in VPS - by AmirGT - 09-14-2017, 11:16 AM
RE: How to change SSH port in VPS - by AmirGT - 09-14-2017, 01:12 PM
RE: How to change SSH port in VPS - by sagher - 09-15-2017, 05:03 AM
RE: How to change SSH port in VPS - by AmirGT - 09-15-2017, 04:04 PM
RE: How to change SSH port in VPS - by AmirGT - 09-17-2017, 12:35 PM

Possibly Related Threads…
Thread
Author
Replies
Views
Last Post
3,015
11-03-2019, 02:31 AM
Last Post: tiwil

person_pin_circle Users browsing this thread: 1 Guest(s)
Sponsors: VirMach - Host4Fun - CubeData - Evolution-Host - HostDare - Hyper Expert - Shadow Hosting - Bladenode - Hostlease - RackNerd - ReadyDedis - Limitless Hosting