Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2007
    Posts
    252

    SSH Related Questions - Pls Help

    Hi Guys.

    I want to restrict access to my SSH port on cpanel/whm to certain IP addresses or to block it, how do I do this?

    Also, how do I change the SSH port from 22 to any other number on cpanel/whm

    Kindly note that I have ConfigServer Security & Firewall installed on the cpanel

    Thank you very much.



    Just Here To Learn

  2. #2
    Join Date
    Jun 2011
    Location
    USA/UK/SG
    Posts
    3,757
    There's a few different options you could use to restrict SSH to certain IP space, such as for example Host Access Control: https://docs.cpanel.net/whm/security...ccess-control/

    Another option is via CSF: https://forum.configserver.com/viewt...bfdbbe6c#p3471

    To change the SSH port, see https://support.cpanel.net/hc/en-us/...e-the-SSH-port
    ~]# Ethernet Servers Ltd - Est. 2014! - hello @ ethernetservers.com
    ~]# Try out our WordPress speed tests for yourself!
    ~]# NVMe Web Hosting | Unmanaged VPS | Dedicated Servers | Domain Names
    ~]# Don't settle for any less than the very best - come & join our family today!

  3. #3
    Join Date
    Nov 2007
    Posts
    252
    Kindly share details with me. It seems I am yet to get it right.



    Just Here To Learn

  4. #4
    Join Date
    Jun 2011
    Location
    USA/UK/SG
    Posts
    3,757
    Quote Originally Posted by ResellerFly View Post
    Kindly share details with me. It seems I am yet to get it right.
    What did you do so far?
    ~]# Ethernet Servers Ltd - Est. 2014! - hello @ ethernetservers.com
    ~]# Try out our WordPress speed tests for yourself!
    ~]# NVMe Web Hosting | Unmanaged VPS | Dedicated Servers | Domain Names
    ~]# Don't settle for any less than the very best - come & join our family today!

  5. #5
    Join Date
    Sep 2002
    Location
    Top Secret
    Posts
    14,289
    1: Use CSF
    2: Remove the port from csf configs in WHM
    3: Add your whitelisted IP's to CSF

    You can't change the ssh port directly within WHM, however you can do so directly from SSH

    just go to /etc/sshd/sshd_config and change in there
    Tom Whiting, WHMCS Guru extraordinaire
    Linux problems? WHMCS Problems? Give me a shout
    Check out my WHMCS Addons

  6. #6
    If you have SSH access, can you not login through SSH, and edit the SSH configuration files?


    You can also use iptables to whitelist IPs:

    This command block will restrict port 80 and 443 to 202.181.177.177 IPv4 address, and will not accept connections from any other IPs.

    iptables -N xxx # create a new chain named xxx

    iptables -A xxx --src 202.181.177.177 -j ACCEPT

    iptables -A xxx -j DROP # drop everyone else

    iptables -I INPUT -m tcp -p tcp --dport 80 -j xxx
    iptables -I INPUT -m tcp -p tcp --dport 443 -j xxx

  7. #7
    Join Date
    Dec 2007
    Location
    Indiana, USA
    Posts
    19,499
    Quote Originally Posted by HammerVM LTD View Post
    If you have SSH access, can you not login through SSH, and edit the SSH configuration files?
    Absolutely, although from the questions they've asked it seems they're not an experienced systems administrator and may not know how to actually do that. Everyone starts somewhere.


    Quote Originally Posted by HammerVM LTD View Post
    You can also use iptables to whitelist IPs:

    This command block will restrict port 80 and 443 to 202.181.177.177 IPv4 address, and will not accept connections from any other IPs.

    iptables -N xxx # create a new chain named xxx

    iptables -A xxx --src 202.181.177.177 -j ACCEPT

    iptables -A xxx -j DROP # drop everyone else

    iptables -I INPUT -m tcp -p tcp --dport 80 -j xxx
    iptables -I INPUT -m tcp -p tcp --dport 443 -j xxx
    As they already have CSF installed, there's no reason to manually manage the IPTables rules for this.
    Michael Denney - MDDHosting.com - Trusted by more than 37,000 websites since 2007.
    Ultra-Fast Cloud Shared and Pay-By-Use Reseller Hosting Powered by LiteSpeed!
    cPanel • Free SSL • 100% Uptime SLA • 24/7 Support
    Class-leading support that responds in minutes, not days.

Similar Threads

  1. Noob php related question....pls help!
    By Eric Karsh in forum Programming Discussion
    Replies: 4
    Last Post: 10-02-2010, 08:46 PM
  2. TOMCAT Questions (pls help)
    By stephenn in forum Hosting Security and Technology
    Replies: 2
    Last Post: 08-30-2002, 11:57 PM
  3. 2 questions, please help:)
    By kdp80 in forum Web Hosting
    Replies: 9
    Last Post: 03-25-2001, 05:34 AM
  4. I need a host for high traffic site. Pls Help!
    By emmanuel in forum Web Hosting
    Replies: 14
    Last Post: 12-23-2000, 07:20 AM
  5. My first site's template, pls help
    By Nam in forum Web Site Reviews
    Replies: 7
    Last Post: 11-19-2000, 04:05 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •