linux - php impersonate user -
I'm trying to do is shell commands from the system I've done the research, there is no way to impersonate a system user to PHP in terms of his (Santos 6.3 to be exact) with PHP 5.4.13. So far I and nothing happens, though, if I'm running: I get the If I cli So what commands have to be able to run from php as root? By running the example of what I am trying to get as root, I want to add the certificate to the up Mr. appreciate the help. Ahh !!! found it! After some time I wrote that, I found Answer web page as root is run .
sudo is set and the line
Apache ALL = (ALL): NOPASSWD for all (test)
/ Etc / sudoers to . I then created a simple php file in the root of your website:
& lt; Php shell_exec ('whoami'); ? & Gt;
apache as a result, so I know that at least shell_exec is working.
Su apache , I found
this account is not currently available. I believe because Apache has a Knowledge Defined (?)
Apache: x: 48: 48: Apache: / var / Www: / sbin / nologin
/ etc / ssl / certificate / https the following command line one The Web Control Panel is called using:
openssl request - new -nodes -x509 -days 3650 \ -subj "/ EmailAddress = $ {ssl_email} / CN = CA. $ { domain_name} / OU = $ {ssl_organisational_unit} / o = $ {ssl_organisation} / L = $ {ssl_location} / ST = $ {ssl_state} / C = $ {ssl_country} "\ -keyout" $ {certroot} / cacert. Pem "out" $ {certificateroot} /cacert.pem "
and
default requiretty to comment out the / etc / sudoers
Comments
Post a Comment