Change SSH Default Port 22 to Custom Port

Change SSH Default Port 22 to Custom Port

1. Access your linux server using SSH with putty any third party software.

2. Enter your sudo user password or root password.

3. Open SSH configuration file using below command in your favorite editor.

 [root@ssh-port-change ~]# vi /etc/ssh/sshd_config 

4. Add “Port 44” line in sshd_config file and save or exit the file.

5. Restart ssh service using below command.

 [root@ssh-port-change ~]# systemctl restart sshd 

6. Open port 44 or custom port in firewall(Firewalld,CFS,IPtables,Microhost cloud firewall,etc) which you have defined in ssh configuration file,if you are using any internal and external firewall on server. For Eg:- firewalld

 [root@ssh-port-change ~]# firewall-cmd –add-port=44/tcp –permanent
[root@ssh-port-change ~]# firewall-cmd –reload

Thank you..


    • Related Articles

    • How to change mysql port number in centOS 7

      Default port of mysql is 3306 . To change the default port to custom port , Please follow the below steps :-  Step 1 : First , use the below command to check the availability of port (port is free or not) . Command : netstat -tanp|grep 3337 Step 2 : ...
    • Access Linux server using SSH in Windows, Linux and Mac OS.

      Part 1: Access Linux server using SSH in Windows 1. Download PuTTY or another PuTTY download source from URL https://the.earth.li/~sgtatham/putty/latest/w64/putty.exe . The file called “putty.exe” is perfect for simple SSH. 2. Save and download ...
    • Install WHM/Cpanel in Centos 7

      Hardware requirements of WHM/Cpanel You have sudo user access or root access to install whm/Cpanel. Step:- 1. Access your server using SSH from putty or any third party software. Here we are using default 22 port for SSH access, If you are using any ...
    • FirewallD with Centos 7

      Firewall is a software program that implements a set of rules that allows or rejects data packets in a network. Firewalld is a dynamic firewall management tool. In this article , you will learn to setup and manage firewall on your server. Install and ...
    • INSTALLATION AND CONFIGURATION OF APACHE TOMCAT 9 ON CENTOS 7

      Apache Tomcat program is an open-source application of Java Servlet, JavaServer Pages, Java Expression Language and Java WebSocket technologies. Under the Java Community Process the Java Servlet, JavaServer Pages, Java Expression Language and Java ...