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.

Is there any way to know my ssh port

Discussion in 'General Discussion' started by yoseman, Nov 2, 2012.

  1. yoseman

    yoseman Member

    Joined:
    Jun 10, 2007
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    I know ssh isnt on default 22 port because csf return me 'Check SSH on non-standard port' as Ok on check server security

    But my problem is I want to connect to do some maintenance tasks and I don't remember the port number because I did it in past(In fact I don't remember to change the ssh port ¿?¿ but if it's changed I must did in past ¿?¿)

    So is there any way to know ssh listen port using only whm.

    Putty tell allways, network error, connection refused, and csf information 'Check SSH on non-standard port' rule say ok

    Thanks.
     
  2. vanessa

    vanessa Well-Known Member
    PartnerNOC

    Joined:
    Sep 26, 2006
    Messages:
    817
    Likes Received:
    22
    Trophy Points:
    18
    Location:
    Virginia Beach, VA
    cPanel Access Level:
    DataCenter Provider
    What I would recommend is

    1) Use the autofixer to temporarily reset SSH access:

    The cPanel Autofixer :: The cPanel Admin

    2) SSH in and look at /etc/ssh/sshd_config to see what port is configured

    3) Then restart SSH again
     
  3. Seaconpackers

    Seaconpackers Registered

    Joined:
    Nov 3, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    If you are accessing it from a OSx machine do the following. The general principle being that you generate an public key and then take your public key and put it on the remote server.

    On your machine

    ssh-keygen -t rsa

    This should generate a id_rsa.pub file in your ~/.ssh directory. Take the contents of this file and paste it on the ~/.ssh/authorized_keys file.

    Some notes to ensure. Both sides should have .ssh and the files under .ssh be with 600 permissions. Or else you will get errors.
     
  4. yoseman

    yoseman Member

    Joined:
    Jun 10, 2007
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for answers, the reset using autofixer go perfectly for me, and now the generated keys works and can acces using putty.

    Thanks :)
     
Loading...

Share This Page