Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Web Server
  • Search

shell_exec("journalctl"); user permissions

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
1 post • Page 1 of 1
jonny1960
Posts: 5
Joined: Tue Jun 26, 2018 7:46 am

Os: CentOS 6x
Web: apache + nginx
shell_exec("journalctl"); user permissions
  • Quote

Post by jonny1960 » Tue Sep 13, 2022 12:09 pm

I'm trying to get log messages of journalctl from PHP, but getting an error - "Hint: You are currently not seeing messages from other users and the system. Users in the 'systemd-journal' group can see all messages."

Code: Select all

shell_exec('whoami') //shows "admin"
Tried to put into /etc/sudoers.d/admin these lines one by one but none of them worked

Code: Select all

%admin ALL=(root) NOPASSWD: /usr/sbin/journalctl
admin ALL=NOPASSWD: /usr/sbin/journalctl
%admin ALL=(ALL) ALL
www-data ALL=NOPASSWD: ALL
shell_exec("sudo -l"); - doesn't indicate that this privilege has been granted

How can I grant privilege to php shell_exec sudo on CENTOS 7 to get this request?
Top


Post Reply
  • Print view
1 post • Page 1 of 1

Return to “Web Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password