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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SSH root access denied/ missing /etc/ssh folder

Discussion in 'General Discussion' started by Adex1, Nov 20, 2016.

Tags:
  1. Adex1

    Adex1 Registered

    Joined:
    Nov 20, 2016
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Belfast
    cPanel Access Level:
    Root Administrator
    Hello guys,

    This is the first time I have to create a post. I usually find all the info I need in other threads created by other users but this case seems more complicated.
    Long story short I am the new admin of a VPS, I can access whm via web with root credential but I can only login via ssh by the user credential.
    Code:
    Password:
    Last login: Mon Nov 7 14:08:06 2016 from somesrvrname.secureserver.net
    [newuser@cp ~]$ su -
    Password:
    su: incorrect password
    [newuser@cp ~]$ sudo
    sudo: effective uid is not 0, is sudo installed setuid root?
    
    I tried to change the root password from whm but via ssh is not recognised. I went inside the /etc/ folder since I was looking for the ssh config just to figure out that the entire ssh folder is missing. My client contacted Godaddy to get help on a system level but they told him that I need to change the setting of the ssh config file. This means that they didn't even check the VPS.

    So, the entire folder is missing. How can I have that folder recreated with the default files? By removing and installing th SSH service again? If so, can you help me with some commands?

    Many thanks
     
    #1 Adex1, Nov 20, 2016
    Last edited by a moderator: Nov 20, 2016
  2. SysSachin

    SysSachin Well-Known Member

    Joined:
    Aug 23, 2015
    Messages:
    568
    Likes Received:
    40
    Trophy Points:
    28
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Twitter:
    Please make sure that you are using correct root password.

    If you are still facing issue with correct password then please try to resetting your SSH configuration from Web Host Manager with the following URL:
    Code:
    https://IP:2087/cpsess12345678/scripts2/doautofixer?autofix=safesshrestart
    
    You would replace "IP" with the server's IP address
     
    #2 SysSachin, Nov 20, 2016
    Last edited by a moderator: Nov 20, 2016
  3. Adex1

    Adex1 Registered

    Joined:
    Nov 20, 2016
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Belfast
    cPanel Access Level:
    Root Administrator
    Hello and thank you for your reply.
    The root password is 100% correct.

    This is the output of the script:
    Code:
    AutoFixer Execution
    Requesting script ...
    
    Done.
    
    
    Executing script ...
    
    
    Attempting to locate sshd binaries installed on the system ...<br />
    Located /usr/sbin/sshd<br />
    Done.<br />
    Killing exisiting sshd processes...<br />
    Stopping sshd: [  OK  ]
    <br />
    Done.<br />
    configuring sshd to run on port 22<br />
    /usr/sbin/sshd successfully started!<br />
    root     12265  0.0  0.0  66240  1312 ?        Rs   06:48   0:00 /usr/sbin/sshd -f /var/cpanel/safe_sshd
    <br />
    
    
    Done.
    
    The issue is still there and the ssh folder in the /etc/ is still missing.
    @SysSachin Any other ideas?
     
    #3 Adex1, Nov 20, 2016
    Last edited by a moderator: Nov 20, 2016
  4. SysSachin

    SysSachin Well-Known Member

    Joined:
    Aug 23, 2015
    Messages:
    568
    Likes Received:
    40
    Trophy Points:
    28
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hi,
    After resetting your SSH configuration then try to access direct with root user and use default ssh port (22)
     
  5. Adex1

    Adex1 Registered

    Joined:
    Nov 20, 2016
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Belfast
    cPanel Access Level:
    Root Administrator
    it worked, thank you very much!!

    can a mod please set this thread as solved?
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page