What user runs the commands defined in /etc/rc.local?
Clash Royale CLAN TAG#URR8PPP
Are the commands in /etc/rc.local
ran by su
by default?
Do I need to specific sudo
before each command or will they be ran by su
regardless?
linux sudo startup su
migrated from serverfault.com Jun 20 '15 at 3:26
This question came from our site for system and network administrators.
add a comment |
Are the commands in /etc/rc.local
ran by su
by default?
Do I need to specific sudo
before each command or will they be ran by su
regardless?
linux sudo startup su
migrated from serverfault.com Jun 20 '15 at 3:26
This question came from our site for system and network administrators.
add a comment |
Are the commands in /etc/rc.local
ran by su
by default?
Do I need to specific sudo
before each command or will they be ran by su
regardless?
linux sudo startup su
Are the commands in /etc/rc.local
ran by su
by default?
Do I need to specific sudo
before each command or will they be ran by su
regardless?
linux sudo startup su
linux sudo startup su
edited Jun 5 '18 at 15:16
schily
10.7k31641
10.7k31641
asked Jun 18 '15 at 16:54
S-K'S-K'
148114
148114
migrated from serverfault.com Jun 20 '15 at 3:26
This question came from our site for system and network administrators.
migrated from serverfault.com Jun 20 '15 at 3:26
This question came from our site for system and network administrators.
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
su
is not a user it's program to run subsequent commands/programs under an alternate identity of another user than the one executing the command. It is very similar to sudo
in that regard.
Unless another user is specified both commands will default to running the command under the alternate identity of the root
user, the superuser/administrator.
The main difference between su
and sudo
is that:
su
requires you to know the password of that alternate user, wheresudo
will prompt for the password of the user running thesudo
command and requires setup so that the user is allowed to run the requested commands/programs.
(When root
runs either su
or sudo
no password is required.)
Like any init script, the /etc/rc.local
script is executed by the root
user and you do not need to prepend either su
or sudo
to the commands/programs that need to run as root.
You may still need to use su
or sudo
in your init scripts if those commands need to be executed not as root
but another user/service-account...
su -
oracle
/do/something/as/oracle/user
What do I do if I put su - user /path/to/script.sh in rc.local, and when sourcing it it prompts me for the user password (and closes the terminal afterwards). How do I make it not ask me for the user's password?
– alonso s
Jan 3 '18 at 1:40
add a comment |
Yes, all the scripts and programs are directly called by root.
The /etc/rc.local
file is called directly by the init process.
So then, we didn't need to addsudo
before commands in/etc/rc.local
?
– Benyamin Jafari
Jun 5 '18 at 14:59
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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
);
);
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%2funix.stackexchange.com%2fquestions%2f210939%2fwhat-user-runs-the-commands-defined-in-etc-rc-local%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
su
is not a user it's program to run subsequent commands/programs under an alternate identity of another user than the one executing the command. It is very similar to sudo
in that regard.
Unless another user is specified both commands will default to running the command under the alternate identity of the root
user, the superuser/administrator.
The main difference between su
and sudo
is that:
su
requires you to know the password of that alternate user, wheresudo
will prompt for the password of the user running thesudo
command and requires setup so that the user is allowed to run the requested commands/programs.
(When root
runs either su
or sudo
no password is required.)
Like any init script, the /etc/rc.local
script is executed by the root
user and you do not need to prepend either su
or sudo
to the commands/programs that need to run as root.
You may still need to use su
or sudo
in your init scripts if those commands need to be executed not as root
but another user/service-account...
su -
oracle
/do/something/as/oracle/user
What do I do if I put su - user /path/to/script.sh in rc.local, and when sourcing it it prompts me for the user password (and closes the terminal afterwards). How do I make it not ask me for the user's password?
– alonso s
Jan 3 '18 at 1:40
add a comment |
su
is not a user it's program to run subsequent commands/programs under an alternate identity of another user than the one executing the command. It is very similar to sudo
in that regard.
Unless another user is specified both commands will default to running the command under the alternate identity of the root
user, the superuser/administrator.
The main difference between su
and sudo
is that:
su
requires you to know the password of that alternate user, wheresudo
will prompt for the password of the user running thesudo
command and requires setup so that the user is allowed to run the requested commands/programs.
(When root
runs either su
or sudo
no password is required.)
Like any init script, the /etc/rc.local
script is executed by the root
user and you do not need to prepend either su
or sudo
to the commands/programs that need to run as root.
You may still need to use su
or sudo
in your init scripts if those commands need to be executed not as root
but another user/service-account...
su -
oracle
/do/something/as/oracle/user
What do I do if I put su - user /path/to/script.sh in rc.local, and when sourcing it it prompts me for the user password (and closes the terminal afterwards). How do I make it not ask me for the user's password?
– alonso s
Jan 3 '18 at 1:40
add a comment |
su
is not a user it's program to run subsequent commands/programs under an alternate identity of another user than the one executing the command. It is very similar to sudo
in that regard.
Unless another user is specified both commands will default to running the command under the alternate identity of the root
user, the superuser/administrator.
The main difference between su
and sudo
is that:
su
requires you to know the password of that alternate user, wheresudo
will prompt for the password of the user running thesudo
command and requires setup so that the user is allowed to run the requested commands/programs.
(When root
runs either su
or sudo
no password is required.)
Like any init script, the /etc/rc.local
script is executed by the root
user and you do not need to prepend either su
or sudo
to the commands/programs that need to run as root.
You may still need to use su
or sudo
in your init scripts if those commands need to be executed not as root
but another user/service-account...
su -
oracle
/do/something/as/oracle/user
su
is not a user it's program to run subsequent commands/programs under an alternate identity of another user than the one executing the command. It is very similar to sudo
in that regard.
Unless another user is specified both commands will default to running the command under the alternate identity of the root
user, the superuser/administrator.
The main difference between su
and sudo
is that:
su
requires you to know the password of that alternate user, wheresudo
will prompt for the password of the user running thesudo
command and requires setup so that the user is allowed to run the requested commands/programs.
(When root
runs either su
or sudo
no password is required.)
Like any init script, the /etc/rc.local
script is executed by the root
user and you do not need to prepend either su
or sudo
to the commands/programs that need to run as root.
You may still need to use su
or sudo
in your init scripts if those commands need to be executed not as root
but another user/service-account...
su -
oracle
/do/something/as/oracle/user
answered Jun 19 '15 at 7:31
HBruijnHBruijn
5,5261525
5,5261525
What do I do if I put su - user /path/to/script.sh in rc.local, and when sourcing it it prompts me for the user password (and closes the terminal afterwards). How do I make it not ask me for the user's password?
– alonso s
Jan 3 '18 at 1:40
add a comment |
What do I do if I put su - user /path/to/script.sh in rc.local, and when sourcing it it prompts me for the user password (and closes the terminal afterwards). How do I make it not ask me for the user's password?
– alonso s
Jan 3 '18 at 1:40
What do I do if I put su - user /path/to/script.sh in rc.local, and when sourcing it it prompts me for the user password (and closes the terminal afterwards). How do I make it not ask me for the user's password?
– alonso s
Jan 3 '18 at 1:40
What do I do if I put su - user /path/to/script.sh in rc.local, and when sourcing it it prompts me for the user password (and closes the terminal afterwards). How do I make it not ask me for the user's password?
– alonso s
Jan 3 '18 at 1:40
add a comment |
Yes, all the scripts and programs are directly called by root.
The /etc/rc.local
file is called directly by the init process.
So then, we didn't need to addsudo
before commands in/etc/rc.local
?
– Benyamin Jafari
Jun 5 '18 at 14:59
add a comment |
Yes, all the scripts and programs are directly called by root.
The /etc/rc.local
file is called directly by the init process.
So then, we didn't need to addsudo
before commands in/etc/rc.local
?
– Benyamin Jafari
Jun 5 '18 at 14:59
add a comment |
Yes, all the scripts and programs are directly called by root.
The /etc/rc.local
file is called directly by the init process.
Yes, all the scripts and programs are directly called by root.
The /etc/rc.local
file is called directly by the init process.
answered Jun 18 '15 at 16:58
dmouratidmourati
23613
23613
So then, we didn't need to addsudo
before commands in/etc/rc.local
?
– Benyamin Jafari
Jun 5 '18 at 14:59
add a comment |
So then, we didn't need to addsudo
before commands in/etc/rc.local
?
– Benyamin Jafari
Jun 5 '18 at 14:59
So then, we didn't need to add
sudo
before commands in /etc/rc.local
?– Benyamin Jafari
Jun 5 '18 at 14:59
So then, we didn't need to add
sudo
before commands in /etc/rc.local
?– Benyamin Jafari
Jun 5 '18 at 14:59
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- 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%2funix.stackexchange.com%2fquestions%2f210939%2fwhat-user-runs-the-commands-defined-in-etc-rc-local%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