Does a user have to log in to run a process and become its owner?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












0














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 by root, and does the user root have to log in before starting the init 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.










share|improve this question























  • 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















0














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 by root, and does the user root have to log in before starting the init 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.










share|improve this question























  • 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













0












0








0







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 by root, and does the user root have to log in before starting the init 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.










share|improve this question















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 by root, and does the user root have to log in before starting the init 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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 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
















  • 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















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










1 Answer
1






active

oldest

votes


















3














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.





share|improve this answer




















  • 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










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
);



);













draft saved

draft discarded


















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









3














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.





share|improve this answer




















  • 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















3














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.





share|improve this answer




















  • 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













3












3








3






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.





share|improve this answer












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.






share|improve this answer












share|improve this answer



share|improve this answer










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
















  • 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

















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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






Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?