How to change default ssh port & why ?
There is a security risk if you are using default ssh port which is 22 Because Hackers can scan for port22 (default port on which ssh listen) to find computers with ssh running, and then they attempt a brute-force attack on that machine.
if you have strong password, hopefully any attack will be logged.
So our task is to change default ssh port
Default = 22
We are going toÂ change with = 7878
Fist we Edit this file
# vi /etc/ssh/sshd_config
Uncomment this line and change port 22 to 7878
Save & Exit
Now restart sshd service using this command
# /etc/init.d/sshd restart
Now reconnect with ssh
For the next time when you connect your machine via ssh you neet to specify port no
with ssh command as shown below
ssh Machine name or ip -p port no
in my cause it will be
# ssh vm1.broexperts.com -p 7878
Hmmm Now we are on lower security Risk……!