is possible the line "apache ALL=(root) NOPASSWD:ALL" into [/etc/sudoers.d/file.test] ?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I know its no help to you but I can reboot from the browser as posted previously on my CentOS 7 VM. Also as posted there must be some configuration differences (not related to php, mysql etc)
Code:
https://web/reboot.php
Have changed scripts? Is it different from the file.php posted previously? If so post the contents minus the php tags.
That is impossible. There are at least three cases:
1. it works, but you could recognize it easily, because reboot will be executed
2. syntactically incorrect command, cannot be executed, in that case after the exec you can check it
3. the command itself is syntactically correct, but for example the sudoers file is corrupt. In that case sudo will print an error message somewhere, but probably it is lost.
I would try to execute a simple shell script instead of reboot, and check if that works. Next I will try to add some logging to that shell script and finally execute sudo reboot inside - and you can check the log and act accordingly.
[Wed Dec 31 19:00:52.660729 1969] [ssl:warn] [pid 568] AH01909: RSA certificate configured for localhost.localdomain:443 does NOT include an ID which matches the server name
[Wed Dec 31 19:00:53.025773 1969] [ssl:warn] [pid 568] AH01909: RSA certificate configured for localhost.localdomain:443 does NOT include an ID which matches the server name
and this is the /var/log/httpd/ssl_error_log updated:
Code:
[Wed Dec 31 19:00:52.660729 1969] [ssl:warn] [pid 568] AH01909: RSA certificate configured for localhost.localdomain:443 does NOT include an ID which matches the server name
[Wed Dec 31 19:00:53.025773 1969] [ssl:warn] [pid 568] AH01909: RSA certificate configured for localhost.localdomain:443 does NOT include an ID which matches the server name
[Tue Apr 19 07:51:42.063155 2022] [cgi:error] [pid 643] [client 192.168.20.36:49632] AH01215: , referer: https://192.168.20.67/rb/
[Tue Apr 19 07:51:42.063618 2022] [cgi:error] [pid 643] [client 192.168.20.36:49632] AH01215: We trust you have received the usual lecture from the local System, referer: https://192.168.20.67/rb/
[Tue Apr 19 07:51:42.063828 2022] [cgi:error] [pid 643] [client 192.168.20.36:49632] AH01215: Administrator. It usually boils down to these three things:, referer: https://192.168.20.67/rb/
[Tue Apr 19 07:51:42.063866 2022] [cgi:error] [pid 643] [client 192.168.20.36:49632] AH01215: , referer: https://192.168.20.67/rb/
[Tue Apr 19 07:51:42.064042 2022] [cgi:error] [pid 643] [client 192.168.20.36:49632] AH01215: #1) Respect the privacy of others., referer: https://192.168.20.67/rb/
[Tue Apr 19 07:51:42.064198 2022] [cgi:error] [pid 643] [client 192.168.20.36:49632] AH01215: #2) Think before you type., referer: https://192.168.20.67/rb/
[Tue Apr 19 07:51:42.064382 2022] [cgi:error] [pid 643] [client 192.168.20.36:49632] AH01215: #3) With great power comes great responsibility., referer: https://192.168.20.67/rb/
[Tue Apr 19 07:51:42.064423 2022] [cgi:error] [pid 643] [client 192.168.20.36:49632] AH01215: , referer: https://192.168.20.67/rb/
[Tue Apr 19 07:51:42.064612 2022] [cgi:error] [pid 643] [client 192.168.20.36:49632] AH01215: sudo: no tty present and no askpass program specified, referer: https://192.168.20.67/rb/
Why do you need 'others commands' for that user?? Again, why are you ignoring the advice you've been given about this being a VERY BAD IDEA???? And why do you ignore SNMP as being an option???
And if it has to be web-based (for some reason that you haven't told us), why don't you just use webmin???
so you have still that the no tty present error
That means sudoers is not configured properly (either permission problem or syntax error or just a typo somewhere).
You can simply try if sudo works from command line for that apache users without web server and browser.
also you need to use sudo -n if no tty present. Probably need to check if askpass is configured somewhere/somehow.
su and sudo are two different programs. su apache is definitely wrong. Also testing sudo as root is insufficient.
you need to read man sudo about askpass.
The web server user, apache in this case is set to nologin so using su or sudo is not possible and why the OP sees the "This account is currently not available." error.
Despite this and as posted I have been able to configure a CentOS 7 VM so it reboots as the OP desires. I'm with pan64 and that something must not be configured correctly or the same as a regular x86_64 system.
[root@localhost ~]# su apache
This account is currently not available.
Sorry, but why are you ignoring things??? Again:
SNMP can be used to remotely reboot a system. Why can't you use that??
Webmin can be used to reboot a system over a web interface. Why can't you use that??
You are NOT paying attention on how to configure sudo.
SU and SUDO are two different commands...why would you expect them to be the same??
You're logged in as root...what is the point of running su??
If you're not going to listen to advice, there isn't much point in posting. This thread is four pages long now, and it doesn't seem like you've even gotten past the basics. What is your actual goal, here??? Is there another person with experience that could do this?
Quote:
Code:
[root@localhost ~]#
is askpass a programm?
Did you actually try to look it up??? Do ANYTHING as far as research on your own???
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.