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.

Access denied for user 'ssh-user'@'localhost' (using password: NO)

Discussion in 'General Discussion' started by kmthayil, Mar 2, 2015.

  1. kmthayil

    kmthayil Registered

    Joined:
    Mar 2, 2015
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello All,

    I need your feedbacks on the below message which I am seeing these days in my apache error_logs (/usr/local/apache/logs/error_log). I have script in place which when executed in the browser, gives me the message,

    PHP Warning: mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Access denied for user 'ssh-user'@'localhost' (using password: NO) in /home/example/public_html/test1121x11.php on line 14

    I have no issues with this error and it is something which I am expecting because the mysql_connect query is getting called without any user/host/password details. So ideally it should either user apache user which is nobody or should be blank. But here, it is taken as ssh-user having wheel group (i use this user for doing su - as root with wheel group)

    Any idea why this is happening. When putting this same script in another server and calling via browser, I get the expected output which is, Access denied for user 'nobody'@'localhost' (using password: NO).

    I can confirm that when checking the phpinfo() of the server, mysql.default_user is set to "no value" and also, apache is run as user nobody when I am checking ps aux

    Can someone suggest what is the issue here?

    Thank you.

    Regards,
    K.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,811
    Likes Received:
    667
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    What PHP handler have you configured in "WHM Home » Service Configuration » Configure PHP and suEXEC"? Are you using Mod_Ruid2? Does this configuration match the other server you referenced?

    Thank you.
     
  3. kmthayil

    kmthayil Registered

    Joined:
    Mar 2, 2015
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello Michael,

    Thank you for the response.

    I can confirm that in both the server I have the following setting.

    Default PHP Version (.php files) 5
    PHP 5 Handler dso
    Apache suEXEC on
    Apache Ruid2 off

    One server gives me output Access denied to 'nobody'@'localhost' and in another it gives me the output Access denied to 'ssh-server'@'localhost'

    NOTE: ssh-user is not the user of the account (domain), but a normal user which I created using `useradd` for doing su - (as direct root access is disabled)

    Any clue why this is ?


    Regards,
    K.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,811
    Likes Received:
    667
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  5. kmthayil

    kmthayil Registered

    Joined:
    Mar 2, 2015
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello Michael,

    Both are installed with Apache 2.2.x and PHP 5.3.x. However OS for the working one (which thows as nobody) is CentOS 5.11 and the other (which throws as ssh-user) is CentOS 6.6

    Just a quick note. When I access the same script using browser from a CentOS 6.6 / PHP 5.5.x / Apache 2.2.x server, it gave message "Access denied to ''@'localhost'. Which also seemed fine.

    Regards,
    K.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,811
    Likes Received:
    667
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Feel free to open a support ticket using the link in my signature so we can take a closer look. You can post the ticket number here so we can update this thread with the outcome.

    Thank you.
     
Loading...

Share This Page