Quote:
Originally posted by cs-cam
The user hasn't been setup with a shell by the looks of it. Post the output of this command:
Code:
/etc/passwd | grep www-data | sed -e "s/.*://g"
You'll need to run it as root but that uses sed to chop out everything we don't need which may include an encrypted password. This will only show us the login shell and if my guess is right then you just need to change the end of this line to read /bin/bash
|
All right, I solved it.
The issue was a little bit more complicated than that.
/bin/bash had weird permissions: (was not executable but by root user)
Having changed them with
Code:
chmod o+rx /bin/bash
changes the error code returned by system("id", $ret_code) invoked in php, from 127 to 126.
That should, from "path not found", to "command was not executable".
Then I discovered that the whole bin/ and /usr/bin/ directories had weird permissions (group ownler couldn't execute nor read).
Giving read and execute permissions to all the commands solved the issue.
I guess it had to do with the plesk installation.
By the way, running
Code:
cat /etc/passwd | grep www-data | sed -e "s/.*://g"
returns
since usually there's no need to assign a shell to apache users.
And letting the user have /bin/false as a shell does not stop php from running shell commands through exec.
Thanks anyway for your help.
Any idea?