Does a user have to log in to run a process and become its owner?
Clash Royale CLAN TAG#URR8PPP
In general, does a user have to log in to run a process and become its owner (ruid, or euid)? Does this apply to any user or any non-root user?
For example:
In the boot sequence of Linux, the kernel starts the init system as the first process, and then the init process runs
login
so that each user can login.
The init process is owned byroot
, and does the userroot
have to log in before starting theinit
process? See Why is there a `systemd` process owned by each user that is logged in?When using
ssh
to run a command without starting an interactive shell, do we have to log in first or not to run the command?
If I don't need to log in to run a process as its owner, how can I do that?
Thanks.
linux process users root
add a comment |
In general, does a user have to log in to run a process and become its owner (ruid, or euid)? Does this apply to any user or any non-root user?
For example:
In the boot sequence of Linux, the kernel starts the init system as the first process, and then the init process runs
login
so that each user can login.
The init process is owned byroot
, and does the userroot
have to log in before starting theinit
process? See Why is there a `systemd` process owned by each user that is logged in?When using
ssh
to run a command without starting an interactive shell, do we have to log in first or not to run the command?
If I don't need to log in to run a process as its owner, how can I do that?
Thanks.
linux process users root
When you SSH into a machine, you provide credentials (either by password or public key) to prove that you have adequate access right to the system as the user that you say you are. This constitutes a logging in. As for the first question, do you know the difference between a service account and an account for an interactive user? See e.g. What is the difference between user and service account?
– Kusalananda
Dec 19 at 13:19
Thanks. How can a service user start a process as its owner or become its owner later?
– Tim
Dec 19 at 14:08
What do you mean by "owner" in this context? A process runs under a uid, has a primary gid, a set of secondary gids, potentially a set of capabilities. There is a parent process (which may beinit
or another process) and there may be some child processes. I'm not sure what you mean by "owner"...
– Stephen Harris
Dec 19 at 15:04
add a comment |
In general, does a user have to log in to run a process and become its owner (ruid, or euid)? Does this apply to any user or any non-root user?
For example:
In the boot sequence of Linux, the kernel starts the init system as the first process, and then the init process runs
login
so that each user can login.
The init process is owned byroot
, and does the userroot
have to log in before starting theinit
process? See Why is there a `systemd` process owned by each user that is logged in?When using
ssh
to run a command without starting an interactive shell, do we have to log in first or not to run the command?
If I don't need to log in to run a process as its owner, how can I do that?
Thanks.
linux process users root
In general, does a user have to log in to run a process and become its owner (ruid, or euid)? Does this apply to any user or any non-root user?
For example:
In the boot sequence of Linux, the kernel starts the init system as the first process, and then the init process runs
login
so that each user can login.
The init process is owned byroot
, and does the userroot
have to log in before starting theinit
process? See Why is there a `systemd` process owned by each user that is logged in?When using
ssh
to run a command without starting an interactive shell, do we have to log in first or not to run the command?
If I don't need to log in to run a process as its owner, how can I do that?
Thanks.
linux process users root
linux process users root
edited Dec 19 at 15:38
asked Dec 19 at 13:13
Tim
26k74246455
26k74246455
When you SSH into a machine, you provide credentials (either by password or public key) to prove that you have adequate access right to the system as the user that you say you are. This constitutes a logging in. As for the first question, do you know the difference between a service account and an account for an interactive user? See e.g. What is the difference between user and service account?
– Kusalananda
Dec 19 at 13:19
Thanks. How can a service user start a process as its owner or become its owner later?
– Tim
Dec 19 at 14:08
What do you mean by "owner" in this context? A process runs under a uid, has a primary gid, a set of secondary gids, potentially a set of capabilities. There is a parent process (which may beinit
or another process) and there may be some child processes. I'm not sure what you mean by "owner"...
– Stephen Harris
Dec 19 at 15:04
add a comment |
When you SSH into a machine, you provide credentials (either by password or public key) to prove that you have adequate access right to the system as the user that you say you are. This constitutes a logging in. As for the first question, do you know the difference between a service account and an account for an interactive user? See e.g. What is the difference between user and service account?
– Kusalananda
Dec 19 at 13:19
Thanks. How can a service user start a process as its owner or become its owner later?
– Tim
Dec 19 at 14:08
What do you mean by "owner" in this context? A process runs under a uid, has a primary gid, a set of secondary gids, potentially a set of capabilities. There is a parent process (which may beinit
or another process) and there may be some child processes. I'm not sure what you mean by "owner"...
– Stephen Harris
Dec 19 at 15:04
When you SSH into a machine, you provide credentials (either by password or public key) to prove that you have adequate access right to the system as the user that you say you are. This constitutes a logging in. As for the first question, do you know the difference between a service account and an account for an interactive user? See e.g. What is the difference between user and service account?
– Kusalananda
Dec 19 at 13:19
When you SSH into a machine, you provide credentials (either by password or public key) to prove that you have adequate access right to the system as the user that you say you are. This constitutes a logging in. As for the first question, do you know the difference between a service account and an account for an interactive user? See e.g. What is the difference between user and service account?
– Kusalananda
Dec 19 at 13:19
Thanks. How can a service user start a process as its owner or become its owner later?
– Tim
Dec 19 at 14:08
Thanks. How can a service user start a process as its owner or become its owner later?
– Tim
Dec 19 at 14:08
What do you mean by "owner" in this context? A process runs under a uid, has a primary gid, a set of secondary gids, potentially a set of capabilities. There is a parent process (which may be
init
or another process) and there may be some child processes. I'm not sure what you mean by "owner"...– Stephen Harris
Dec 19 at 15:04
What do you mean by "owner" in this context? A process runs under a uid, has a primary gid, a set of secondary gids, potentially a set of capabilities. There is a parent process (which may be
init
or another process) and there may be some child processes. I'm not sure what you mean by "owner"...– Stephen Harris
Dec 19 at 15:04
add a comment |
1 Answer
1
active
oldest
votes
No, you don’t need to log in to start a process running as a given user. Logging in is a user-space construct; the kernel doesn’t care about that. There are multiple examples of this; for example, cron jobs can run as any user, without that user being logged in.
To address your specific questions:
- no, root doesn’t need to log in to start the
init
process, thankfully (imagine handling a fleet of thousands of servers and millions of VMs otherwise); - connecting using SSH counts as logging in.
Thanks. If I want run a process as its owner without logging in, how can I do that? Is the only way to call setuid() or seteuid() in the program run by the process?
– Tim
Dec 19 at 13:39
That’s another question.
– Stephen Kitt
Dec 19 at 13:39
Could you explain what you meant by "logging in"? That has led to several other questions.
– Tim
Dec 21 at 1:34
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%2f489909%2fdoes-a-user-have-to-log-in-to-run-a-process-and-become-its-owner%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
No, you don’t need to log in to start a process running as a given user. Logging in is a user-space construct; the kernel doesn’t care about that. There are multiple examples of this; for example, cron jobs can run as any user, without that user being logged in.
To address your specific questions:
- no, root doesn’t need to log in to start the
init
process, thankfully (imagine handling a fleet of thousands of servers and millions of VMs otherwise); - connecting using SSH counts as logging in.
Thanks. If I want run a process as its owner without logging in, how can I do that? Is the only way to call setuid() or seteuid() in the program run by the process?
– Tim
Dec 19 at 13:39
That’s another question.
– Stephen Kitt
Dec 19 at 13:39
Could you explain what you meant by "logging in"? That has led to several other questions.
– Tim
Dec 21 at 1:34
add a comment |
No, you don’t need to log in to start a process running as a given user. Logging in is a user-space construct; the kernel doesn’t care about that. There are multiple examples of this; for example, cron jobs can run as any user, without that user being logged in.
To address your specific questions:
- no, root doesn’t need to log in to start the
init
process, thankfully (imagine handling a fleet of thousands of servers and millions of VMs otherwise); - connecting using SSH counts as logging in.
Thanks. If I want run a process as its owner without logging in, how can I do that? Is the only way to call setuid() or seteuid() in the program run by the process?
– Tim
Dec 19 at 13:39
That’s another question.
– Stephen Kitt
Dec 19 at 13:39
Could you explain what you meant by "logging in"? That has led to several other questions.
– Tim
Dec 21 at 1:34
add a comment |
No, you don’t need to log in to start a process running as a given user. Logging in is a user-space construct; the kernel doesn’t care about that. There are multiple examples of this; for example, cron jobs can run as any user, without that user being logged in.
To address your specific questions:
- no, root doesn’t need to log in to start the
init
process, thankfully (imagine handling a fleet of thousands of servers and millions of VMs otherwise); - connecting using SSH counts as logging in.
No, you don’t need to log in to start a process running as a given user. Logging in is a user-space construct; the kernel doesn’t care about that. There are multiple examples of this; for example, cron jobs can run as any user, without that user being logged in.
To address your specific questions:
- no, root doesn’t need to log in to start the
init
process, thankfully (imagine handling a fleet of thousands of servers and millions of VMs otherwise); - connecting using SSH counts as logging in.
answered Dec 19 at 13:24
Stephen Kitt
164k24365444
164k24365444
Thanks. If I want run a process as its owner without logging in, how can I do that? Is the only way to call setuid() or seteuid() in the program run by the process?
– Tim
Dec 19 at 13:39
That’s another question.
– Stephen Kitt
Dec 19 at 13:39
Could you explain what you meant by "logging in"? That has led to several other questions.
– Tim
Dec 21 at 1:34
add a comment |
Thanks. If I want run a process as its owner without logging in, how can I do that? Is the only way to call setuid() or seteuid() in the program run by the process?
– Tim
Dec 19 at 13:39
That’s another question.
– Stephen Kitt
Dec 19 at 13:39
Could you explain what you meant by "logging in"? That has led to several other questions.
– Tim
Dec 21 at 1:34
Thanks. If I want run a process as its owner without logging in, how can I do that? Is the only way to call setuid() or seteuid() in the program run by the process?
– Tim
Dec 19 at 13:39
Thanks. If I want run a process as its owner without logging in, how can I do that? Is the only way to call setuid() or seteuid() in the program run by the process?
– Tim
Dec 19 at 13:39
That’s another question.
– Stephen Kitt
Dec 19 at 13:39
That’s another question.
– Stephen Kitt
Dec 19 at 13:39
Could you explain what you meant by "logging in"? That has led to several other questions.
– Tim
Dec 21 at 1:34
Could you explain what you meant by "logging in"? That has led to several other questions.
– Tim
Dec 21 at 1:34
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f489909%2fdoes-a-user-have-to-log-in-to-run-a-process-and-become-its-owner%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
When you SSH into a machine, you provide credentials (either by password or public key) to prove that you have adequate access right to the system as the user that you say you are. This constitutes a logging in. As for the first question, do you know the difference between a service account and an account for an interactive user? See e.g. What is the difference between user and service account?
– Kusalananda
Dec 19 at 13:19
Thanks. How can a service user start a process as its owner or become its owner later?
– Tim
Dec 19 at 14:08
What do you mean by "owner" in this context? A process runs under a uid, has a primary gid, a set of secondary gids, potentially a set of capabilities. There is a parent process (which may be
init
or another process) and there may be some child processes. I'm not sure what you mean by "owner"...– Stephen Harris
Dec 19 at 15:04