Networking, Programming and Graphics Tutorials
Home >> OS >> Linux >> SSH >>

How to change the port of my SSH connection [1/2]

Type: Code Networking, Programming and Graphics Tutorials
How to change the port of my SSH connection
Level: Intermediate Networking, Programming and Graphics Tutorials Networking, Programming and Graphics Tutorials 
How to change the port of my SSH connection
Date: 2007-Mar-15
How to change the port of my SSH connection
Visited: 3009 times
How to change the port of my SSH connection
Rating: How to change the port of my SSH connection
How to change the port of my SSH connection
Author: Tony Potter

This tutorial will show you how you can change the port of your SSH connection. This will help you to avoid automated brute-force attacks to your server. To make this change we are going to change that editing the settings in 'sshd_config' file.

Most of the attacks are made by bots, not from a real person and they are targeted to the default services ports. When you change the port the shh service won't be attacked by artificial scripts, as it takes to much time the whole ports diapason to be checked.

The tutorial is written for Red Hat Linux like operating systems – Fedora, CentOS etc.

Connect to your server with SSH client . Switch to root and type:

vi /etc/ssh/sshd_config
and you will see the file opened into VIM editor.
The reason why we use VIM is because it is installed on almost all Unix/Linux based operating systems.
To find the port option type:
'Esc' key then ':' and '?Port' and using the 'n' key locate this string:

Port 22

This is the default port number for your SSH.

Networking, Programming and Graphics Tutorials - How to change the port of my SSH connection [1/2] - Networking, Programming and Graphics Tutorials

Need a specific tutorial? Do not hesitate and submit a request!
Related Tags: how to change connection port  how change connection port ssh  change connection port  windows xp change ssh connection port  change remote desktop connection port  remote desktop connection port change  windows xp remote desktop change connection port  how to change port remote desktop connection win2003  How can I change connection settings in ICQ  establish ftp connection to change website