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.

OpenSSH, the autofixer, and ports

Discussion in 'General Discussion' started by lizolh, Oct 25, 2016.

Tags:
  1. lizolh

    lizolh Registered

    Joined:
    Oct 25, 2016
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    USA
    cPanel Access Level:
    Root Administrator
    Hi folks,

    Today I upgraded MySQL from 5.1 to 5.5 (as requested by WHM/cpanel) which wound up rebuilding Apache and PHP along the way. Afterwards, though, OpenSSH went down and stayed that way, giving the the following message:

    Starting sshd: /etc/ssh/sshd_config: line 97: Bad configuration option: UseDNS
    /etc/ssh/sshd_config: line 100: Bad configuration option: UsePAM
    /etc/ssh/sshd_config: terminating, 2 bad configuration options
    [FAILED]


    I browsed these very forums and discovered the WHM autofixer! I ran safesshrestart, which gave me:

    Executing script ...

    Attempting to locate sshd binaries installed on the system ...
    Located /usr/sbin/sshd
    Done.
    Killing exisiting sshd processes...
    killed 9466 killed 9468 killed 11110 killed 11120 killed 14513 killed 18316 killed 27434 killed 30394 killed 30451 killed 30453 Done.
    Attempting to locate available port ...
    port 22 is already in use
    configuring sshd to run on port 23
    /usr/sbin/sshd successfully started!
    root 4765 0.0 0.0 22784 948 ? Rs 13:18 0:00 /usr/sbin/sshd -f /var/cpanel/safe_sshd

    Done.

    However, I would both like to understand what happened in the first place, and I would prefer that eventually OpenSSH go back to using port 22 once I figure out what it was conflicting with in the first place. Any suggestions for where to start looking, and what to do next? Should I try a fresh reinstall (and if so, what would be the best way to do that that wouldn't lead to locking myself out of this remote server)?

    Thanks!
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,037
    Likes Received:
    1,278
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    A new cPanel installation isn't required. Instead, you can manually modify your /etc/ssh/sshd_config file via the instructions at:

    How to Secure SSH - cPanel Knowledge Base - cPanel Documentation

    Regarding how it happened, do you know if you made any manual changes to this file in the past? You can paste the contents of this file here in CODE tags if you want us to take a closer look.

    Thank you.
     
Loading...

Share This Page