Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

SSH port

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

  1. crazyaboutlinux

    crazyaboutlinux Well-Known Member

    Joined:
    Nov 3, 2007
    Messages:
    941
    Likes Received:
    0
    Trophy Points:
    66
    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:
    16,309
    Likes Received:
    393
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    rhenderson likes this.
  3. arunsv84

    arunsv84 Well-Known Member

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

    netstat -lnp |grep ssh

    Cheers!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. crazyaboutlinux

    crazyaboutlinux Well-Known Member

    Joined:
    Nov 3, 2007
    Messages:
    941
    Likes Received:
    0
    Trophy Points:
    66
    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:
    1
    Trophy Points:
    166
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #5 rhenderson, Feb 10, 2009
    Last edited: Feb 11, 2009
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice