Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I have a tricky step to walk for my system (openvpn, 20 clients - raspberries, 1 server CentOS).

I want to make an auto install, from clients, for their keys. They call a php page on the server, which generate a .tar containing client.key, client.crt & ca.crt (and conf).

Allright this works perfectly in root ssh. Now I make a php script with a shell_exec(my shell script).

But almost all commands fails. A matter of being root or not (my php is in /home/non-root-user/public_html/testgenerateforinit)

for instance : pkitool, cp /etc/openvpn/mykey.tgz /home/.../public_html/.../ fails in php.

How should I process ? Tks

share|improve this question
    
You'll have to give use some more information. At a minimum: (1) the code that generates the .tar, which I assume is just a few lines. (2) How you know the shell_exec() call fails - what error messages, etc. (3) What appears in /var/log/httpd/error_log, or where ever CentOS keeps it's apache error log files. (4) The permissions and ownership of "my shell script" –  Bruce Ediger Jun 5 at 14:20
    
thanks. i solved it another way( c b low) –  ArchiT3K Jun 8 at 11:57

1 Answer 1

Oh finally, I had a NULL feedback, cause of sudo only for terminal (tty). deactivted it for my user. It works a charm now.

$ visudo
#in sudoers :
Defaults:myusername !requiretty
share|improve this answer
    
oh, and :1/ I passed all absolute-path (avoid php chi); 2/ I made myuser sudoer with no password for executing easy-rsa/build-key. –  ArchiT3K Jun 8 at 12:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.