The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SSH port

Discussion in 'General Discussion' started by crazyaboutlinux, Feb 10, 2009.

  1. crazyaboutlinux

    crazyaboutlinux Well-Known Member

    Joined:
    Nov 3, 2007
    Messages:
    938
    Likes Received:
    0
    Trophy Points:
    16
    hello,

    how to check that which port is running on SSH

    i am using
    CENTOS 4.7 i686 on standard
    cPanel 11.24.4-R33609 - WHM 11.24.2 - X 3.9

    Thanks
    Nilesh
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,453
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    rhenderson likes this.
  3. arunsv84

    arunsv84 Well-Known Member

    Joined:
    Oct 20, 2008
    Messages:
    373
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    127.0.0.1
    cPanel Access Level:
    Root Administrator
    Type this command in shell...

    netstat -lnp |grep ssh

    Cheers!
     
  4. crazyaboutlinux

    crazyaboutlinux Well-Known Member

    Joined:
    Nov 3, 2007
    Messages:
    938
    Likes Received:
    0
    Trophy Points:
    16
    hi

    thanks it is working

    i have 2 more questions

    1. can i check the same using WHM ??

    2. now let me know how to change default port 22 & which new port should use ??

    Thanks
    Nilesh
     
  5. rhenderson

    rhenderson Well-Known Member

    Joined:
    Apr 21, 2005
    Messages:
    785
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Oklahoma
    cPanel Access Level:
    Root Administrator
    nano /etc/ssh/sshd_config

    Code:
    Change
    #Port 22
    to
    Port 3474
    
    Of course I just made up 3474, pick a number of a port that is not being used, be sure to open your firewall and remove the comment character #. If your not sure about a port conflict, i.e. using a port already for something else look at the ports already open in your firewall and choose one that is not there, or search on here for firewall ports and there should be a list, again choose one not in use.

    More suggestions

    Code:
    Protocol 2
    ListenAddress 192.168.0.1
    
    Make the listen address one of your IP's the 192.168.0.1 was just an example. This will limit what IP can ssh in which is a little more secure :) Instead of allowing any of your IP's to be able to ssh.

    You cpuld even make an A entry in your DNS zone ie ssh.domain.com and if you ever need to change your IP you would not have to notify your clients (because they are using ssh.domain.com) you could simply change the A record.
     
    #5 rhenderson, Feb 10, 2009
    Last edited: Feb 11, 2009
Loading...

Share This Page