How to run “systemctl” + $ + “apache” $=stop,start,restart as non sudo/root user?How can I run PHP...
Unknown code in script
Prove that the countable union of countable sets is also countable
"My boss was furious with me and I have been fired" vs. "My boss was furious with me and I was fired"
Find a stone which is not the lightest one
Retract an already submitted recommendation letter (written for an undergrad student)
How to pronounce 'c++' in Spanish
"The cow" OR "a cow" OR "cows" in this context
std::unique_ptr of base class holding reference of derived class does not show warning in gcc compiler while naked pointer shows it. Why?
A strange hotel
Can a stored procedure reference the database in which it is stored?
Combinatorics problem, right solution?
Work requires me to come in early to start computer but wont let me clock in to get paid for it
Multiple fireplaces in an apartment building?
How do I deal with a coworker that keeps asking to make small superficial changes to a report, and it is seriously triggering my anxiety?
How long after the last departure shall the airport stay open for an emergency return?
How exactly does Hawking radiation decrease the mass of black holes?
Could moose/elk survive in the Amazon forest?
Help with my training data
Double-nominative constructions and “von”
Restricting the options of a lookup field, based on the value of another lookup field?
Why do distances seem to matter in the Foundation world?
Where was the County of Thurn und Taxis located?
How much of a wave function must reside inside event horizon for it to be consumed by the black hole?
How to keep bees out of canned beverages?
How to run “systemctl” + $ + “apache” $=stop,start,restart as non sudo/root user?
How can I run PHP scripts without prefixing my scripts with sudo?How do I run specific sudo commands without a password?Should I use a separate 'admin' user as my “root sudo” or grant sudo to my 'app' user?Run program as root without using sudois there some way to make windows owned by root (sudo) look different from normal user ones?User B can sudo to an user A (not root or group admin)allowing user to run systemctl/systemd services without passworduser in sudo group can't run sudoHow can I configure visudo to run a script with root privileges for a non root user?How do I run commands as a non-root user in a script started with root permissions?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
Yeah basically the title,
I want to do that things from a app that can run Linux scripts per SSH.
I only want to run these three and not ALL from systemctl with my basic user.
So thanks.
sudo debian visudo
New contributor
Just a dude is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
Yeah basically the title,
I want to do that things from a app that can run Linux scripts per SSH.
I only want to run these three and not ALL from systemctl with my basic user.
So thanks.
sudo debian visudo
New contributor
Just a dude is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
Yeah basically the title,
I want to do that things from a app that can run Linux scripts per SSH.
I only want to run these three and not ALL from systemctl with my basic user.
So thanks.
sudo debian visudo
New contributor
Just a dude is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Yeah basically the title,
I want to do that things from a app that can run Linux scripts per SSH.
I only want to run these three and not ALL from systemctl with my basic user.
So thanks.
sudo debian visudo
sudo debian visudo
New contributor
Just a dude is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Just a dude is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Just a dude is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 13 hours ago
Just a dudeJust a dude
1
1
New contributor
Just a dude is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Just a dude is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Just a dude is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Create a Cmnd_Alias in /etc/sudoers like:
Cmnd_Alias APACHEADMIN = /usr/bin/systemctl start apache2, /usr/bin/systemctl restart apache2, /usr/bin/systemctl stop apache2
Then add a line for the user privilege:
jsmith ALL = NOPASSWD: APACHEADMIN
Hey man thanks, but it doesnt work. I still get the Info to do this thing as sudo/root. I think I need the rights for the Service that i will change too, or something like this.
– Just a dude
5 hours ago
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Just a dude is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1137990%2fhow-to-run-systemctl-apache-stop-start-restart-as-non-sudo-root-user%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Create a Cmnd_Alias in /etc/sudoers like:
Cmnd_Alias APACHEADMIN = /usr/bin/systemctl start apache2, /usr/bin/systemctl restart apache2, /usr/bin/systemctl stop apache2
Then add a line for the user privilege:
jsmith ALL = NOPASSWD: APACHEADMIN
Hey man thanks, but it doesnt work. I still get the Info to do this thing as sudo/root. I think I need the rights for the Service that i will change too, or something like this.
– Just a dude
5 hours ago
add a comment |
Create a Cmnd_Alias in /etc/sudoers like:
Cmnd_Alias APACHEADMIN = /usr/bin/systemctl start apache2, /usr/bin/systemctl restart apache2, /usr/bin/systemctl stop apache2
Then add a line for the user privilege:
jsmith ALL = NOPASSWD: APACHEADMIN
Hey man thanks, but it doesnt work. I still get the Info to do this thing as sudo/root. I think I need the rights for the Service that i will change too, or something like this.
– Just a dude
5 hours ago
add a comment |
Create a Cmnd_Alias in /etc/sudoers like:
Cmnd_Alias APACHEADMIN = /usr/bin/systemctl start apache2, /usr/bin/systemctl restart apache2, /usr/bin/systemctl stop apache2
Then add a line for the user privilege:
jsmith ALL = NOPASSWD: APACHEADMIN
Create a Cmnd_Alias in /etc/sudoers like:
Cmnd_Alias APACHEADMIN = /usr/bin/systemctl start apache2, /usr/bin/systemctl restart apache2, /usr/bin/systemctl stop apache2
Then add a line for the user privilege:
jsmith ALL = NOPASSWD: APACHEADMIN
answered 13 hours ago
FeliciaFelicia
16
16
Hey man thanks, but it doesnt work. I still get the Info to do this thing as sudo/root. I think I need the rights for the Service that i will change too, or something like this.
– Just a dude
5 hours ago
add a comment |
Hey man thanks, but it doesnt work. I still get the Info to do this thing as sudo/root. I think I need the rights for the Service that i will change too, or something like this.
– Just a dude
5 hours ago
Hey man thanks, but it doesnt work. I still get the Info to do this thing as sudo/root. I think I need the rights for the Service that i will change too, or something like this.
– Just a dude
5 hours ago
Hey man thanks, but it doesnt work. I still get the Info to do this thing as sudo/root. I think I need the rights for the Service that i will change too, or something like this.
– Just a dude
5 hours ago
add a comment |
Just a dude is a new contributor. Be nice, and check out our Code of Conduct.
Just a dude is a new contributor. Be nice, and check out our Code of Conduct.
Just a dude is a new contributor. Be nice, and check out our Code of Conduct.
Just a dude is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1137990%2fhow-to-run-systemctl-apache-stop-start-restart-as-non-sudo-root-user%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown