Results 1 to 14 of 14

Thread: Custom ssh port for CPanel SSH client

  1. #1
    Member
    Join Date
    Jun 2003
    Posts
    67

    Default Custom ssh port for CPanel SSH client

    Does anyone know how I can configure CPanel default SSH java client to connect to SSH to my custom port and not to default 22 port?

    I was forced to change SSH port because of security warnings, but know CPanel SSH client cannot connect - he is still trying to connect to 22 port.... It must have some way to be configured...

  2. #2
    Member sawbuck's Avatar
    Join Date
    Jan 2004
    Posts
    1,342
    cPanel/WHM Access Level

    Root Administrator

    Default

    You should be able to define a custom port in /etc/ssh/sshd_config. Make sure your firewall is accepting connections thru that port. Might be a good idea to leave 22 open until you confirm that the non-standard port is working properly. As always make a backup of the original file before editing. Then restart SSH server.
    HTH

  3. #3
    Member
    Join Date
    Jun 2003
    Posts
    67

    Default

    Quote Originally Posted by sawbuck
    You should be able to define a custom port in /etc/ssh/sshd_config. Make sure your firewall is accepting connections thru that port. Might be a good idea to leave 22 open until you confirm that the non-standard port is working properly. As always make a backup of the original file before editing. Then restart SSH server.
    HTH
    I am sorry, you probably did not understood me.
    I alredy setup SSH on another port and it is working fine from all normal SSH clients who have an ability to connect to different port.
    My only problem is CPanel prebuild SSH java client software. It always try to connect to 22 port and I need to update this setting only.

  4. #4
    Member sawbuck's Avatar
    Join Date
    Jan 2004
    Posts
    1,342
    cPanel/WHM Access Level

    Root Administrator

    Default

    Sorry. I did misunderstand what you were asking for. Try /usr/local/cpanel/java-sys/ssh-cp.conf
    Haven't tried to change this myself but would be interested to know if that solves it for you.

  5. #5
    Member
    Join Date
    Jun 2003
    Posts
    67

    Default

    Thank you very much, configuration of this this file really did the job. Now CPanel shell client connecting to right port.

  6. #6
    Member
    Join Date
    Jun 2003
    Location
    the dark side of the moon
    Posts
    31

    Default

    Do You now if the CPanel/whm upgrades turn the port numbers back to the default one?
    =====================
    Rebelo

  7. #7
    Member
    Join Date
    Oct 2004
    Posts
    8

    Default

    When I changed the ssh port, there is error in WHM while I restart the ssh service.
    Is there anywhere in WHM configuration that we should change to tell whm about the new port?

    but it seems there is no problem with ssh , and it is working fine.
    JraNil - as it is B33/\/

  8. #8
    Member
    Join Date
    Jun 2004
    Location
    Canada
    Posts
    378

    Default

    yup you will get the error.. just ignore it.

    Sheldon
    Sheldon King
    Server Adminisrator
    http://www.forgehosting.com

  9. #9
    Member
    Join Date
    Nov 2002
    Posts
    1,782
    cPanel/WHM Access Level

    DataCenter Provider

    Default

    Quote Originally Posted by JraNil
    When I changed the ssh port, there is error in WHM while I restart the ssh service.
    Is there anywhere in WHM configuration that we should change to tell whm about the new port?

    but it seems there is no problem with ssh , and it is working fine.
    Just to clear this out, during the next cpanel update, your config file is overwritten again.

    I just tested this out myself.

    What you can do is create a file /scripts/postupcp and put this inside it:

    Code:
    #!/bin/sh
    perl -pi -e 's/22/NEWPORT/g' /usr/local/cpanel/java-sys/ssh-cp.conf
    chmod 700 /scripts/postupcp

    The above code assumes that the ssh-cp.conf file will have 22 only for the port address For now it holds true. Replace NEWPORT with your custom ssh port.

    Now everytime your cpanel updates, the ssh-cp.conf will be changed back to your custom ssh port.
    :: Anand ::

    ssh root@
    who the hell is root ???

    Cpanelappz Support Forums are up now. Register Today
    http://forums.cpanelappz.com

    WHM/cPanel API : http://whmapi.cpanelappz.com
    Cpanel Login Script : www.cpanelappz.com/cpanel-login-script.htm
    Exiscan+Clam+Exim Auto Installer : www.cpanelappz.com

  10. #10
    Member
    Join Date
    Jun 2003
    Location
    the dark side of the moon
    Posts
    31

    Default error ?

    "When I changed the ssh port, there is error in WHM while I restart the ssh service."

    What type of error ?
    From checkservd with 5 minutes emails saying that a restart was attempted ?

    If we use the /scripts/postupcp from anand before we change ports at /etc/ssh/sshd_config
    and /usr/local/cpanel/java-sys/ssh-cp.conf and then restart ssh will this error be avoided ?

    Tks for help.
    =====================
    Rebelo

  11. #11
    Member
    Join Date
    Oct 2003
    Posts
    1,020

    Default

    Why is this thread sticky?

  12. #12
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,496

    Default

    Quote Originally Posted by SarcNBit
    Why is this thread sticky?
    Maybe someone spilt jam on it

    I noticed last night that some of the cPanel staff were doing a blitz (josh and nick I think) and answering posts. I would suspect they saw it and thought it merited stickiness - or maybe they got the wrong thread
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  13. #13
    Member
    Join Date
    Oct 2003
    Posts
    1,020

    Default

    Quote Originally Posted by chirpy
    or maybe they got the wrong thread
    I hope so. I would reserve sticky status for posts that are extremely timely or posts that are beneficial to a large percentage of forum members. I do not think that this post qualifies.

    I wouldn't think a lot of cpanel hosts are looking for this solution, and those that are could easily run a search on 'ssh port' and read up to find the answer.

    It is interesting sometimes to note how moderation is applied to these forums.

  14. #14
    Member
    Join Date
    Jun 2004
    Location
    Canada
    Posts
    378

    Default

    ever think that they might be stickying this because of a futrue enhancement?

    and btw..

    the choice to change IP's as well would be greatly apreciated.

    ive searched the documentation for the actual java product and I cant find the
    option to specify a different IP.

    Sheldon
    Sheldon King
    Server Adminisrator
    http://www.forgehosting.com

Similar Threads

  1. How to get SSH port from cPanel (API2)
    By mberchtold in forum cPanel Developers
    Replies: 2
    Last Post: 04-02-2009, 10:32 AM
  2. Cpanel 11 SSH Client
    By krisrmgua in forum cPanel & WHM Discussions
    Replies: 0
    Last Post: 07-25-2007, 05:01 PM
  3. ssh java client with cpanel [moved]
    By linuxgirl in forum New User Questions
    Replies: 1
    Last Post: 05-01-2005, 11:13 PM
  4. ssh/telnet client in cpanel
    By Secret Agent in forum cPanel & WHM Discussions
    Replies: 5
    Last Post: 11-26-2004, 10:36 PM
  5. WHM / cPanel / Named AFTER switching SSH port
    By sgemma in forum cPanel & WHM Discussions
    Replies: 3
    Last Post: 01-22-2004, 11:24 AM