empresive

Member
Jan 25, 2008
9
0
51
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.
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
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.
 

empresive

Member
Jan 25, 2008
9
0
51
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.
 
Last edited:

troxalias

Well-Known Member
Nov 21, 2001
96
0
306
Athens - Greece
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.
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.
 

empresive

Member
Jan 25, 2008
9
0
51
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.
 
Last edited: