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 question

Discussion in 'General Discussion' started by empresive, Feb 14, 2008.

  1. empresive

    empresive Member

    Joined:
    Jan 25, 2008
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Hi, i was wondering if anyone could help me with a issue i have. I been trying to access a thing called SSH well SSH aint realy my problem its more of the SFTP. I been trying to access my server using the SSHterm in cpanel, i can login fine but when it comes to root access im unable to gain it. I used my username and password i would use to gain root access with SSH but i cant do it wiht SFTP. My Service provider said there should be somthing in cpanel or WHM to enable root access for the SFTP and i looked all over and im unable to find anything about changeing permissions or enableing root access for it. Has anyone every had this problem? cause i need root access to get to /var/spool/cron/ but like i said i get permisson denied:mad: can anyone help me with gaining root access using SSHterm.
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Have you tried logging in directly as root instead of logging in as another account then su'ing to root? You will not be able to su from another account unless they are in the wheel group. You can control users who are in the wheel group by going to WHM -> Security -> Manage Wheel Group Users.
     
  3. empresive

    empresive Member

    Joined:
    Jan 25, 2008
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    It wont let me login directly with root. The username and password i used is the one i made when setting up my vps, but it dont work i been told i cant login remotely with the username root. Plus i cant even us the command su - root. I logged back in the SSHterm and opend the SFTP session and whent to /ect/ssh/ and got the sshd_config and i looked for the line that says permit root access and its set to NO, and im unable to overwrite it.
     
    #3 empresive, Feb 14, 2008
    Last edited: Feb 14, 2008
  4. troxalias

    troxalias Well-Known Member

    Joined:
    Nov 21, 2001
    Messages:
    96
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Athens - Greece
    You should login to your server using a pure SSH Client. I don't know if SSHterm allows that, but Putty is always handy in these cases. When you login to your server with ssh you could issues the following command
    Code:
    perl -p -i -e 's/PermitRootLogin no/PermitRootLogin yes/g' /etc/ssh/sshd_config
    /etc/init.d/sshd restart
    
    Verify now that you can directly connect with the user root using your ssh client. In case it fails try the above perl search'n'replace command with different case for no (ex. No , NO, nO or no ) until it succeeds :)

    You could then do what you want to do with sftp and turn the above mentioned option back to it's original value.
     
  5. empresive

    empresive Member

    Joined:
    Jan 25, 2008
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Thanks, ill give this a try and pray it works :)
     
  6. empresive

    empresive Member

    Joined:
    Jan 25, 2008
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Ok i did that command now PermitRootAccess is now set to yes, but when i scroll down to
    DenyUsers and DenyGroups they both are set to root. Is there a command i can run in ssh to remove root from the DenyUsers and DenyGroups lines.
     
    #6 empresive, Feb 14, 2008
    Last edited: Feb 14, 2008
Loading...

Share This Page