Is there a way to identify the user who owns a process from /proc/PIDHow to get PID of background process?Alternative to /proc/PID/exe symlink for retrieving another processes full path via PIDHow do I find the owning PID of a socket using only /proc/proc/[pid]/pagemaps and /proc/[pid]/maps | linuxCalculating memory of a Process using Proc file systemWhat is a .pid file and what does it contain?How to decode /proc/pid/pagemap entries in Linux?Does /proc/[pid]/net/tcp refers to only to sockets owned by [pid]?Linux: Reading the output of readlink /proc/pid/exe within a Bash ScriptWhy is CapEff all zeros in /proc/$PID/status
How to deal with a Murder Hobo Paladin?
What is the shape of the upper boundary of water hitting a screen?
Why did Super-VGA offer the 5:4 1280*1024 resolution?
SOQL Query (or other means) to get the icon assigned to an object
Motorcyle Chain needs to be cleaned every time you lube it?
How predictable is $RANDOM really?
Can a USB hub be used to access a drive from two devices?
Is there an upper limit on the number of cards a character can declare to draw from the Deck of Many Things?
How did Einstein know the speed of light was constant?
What's the difference between a type and a kind?
Minor differences between two recorded guitars
Taking my Ph.D. advisor out for dinner after graduation
Options for quick email reply to the effect of "I've just done it" or "I've taken care of it"
Why is there paternal, for fatherly, fraternal, for brotherly, but no similar word for sons?
Initializing variables in an "if" statement
What is the fundamental difference between catching whales and hunting other animals?
Why does mean tend be more stable in different samples than median?
As a supervisor, what feedback would you expect from a PhD who quits?
Why was no first prize awarded at a competition?
How to get the speed of my spaceship?
Multi-user CRUD: Valid, Problem, or Error?
What is the meaning of "prairie-dog" in this sentence?
Passwordless authentication - how invalidate login code
Does the sensor of a dslr count the number of photons that hits it?
Is there a way to identify the user who owns a process from /proc/PID
How to get PID of background process?Alternative to /proc/PID/exe symlink for retrieving another processes full path via PIDHow do I find the owning PID of a socket using only /proc/proc/[pid]/pagemaps and /proc/[pid]/maps | linuxCalculating memory of a Process using Proc file systemWhat is a .pid file and what does it contain?How to decode /proc/pid/pagemap entries in Linux?Does /proc/[pid]/net/tcp refers to only to sockets owned by [pid]?Linux: Reading the output of readlink /proc/pid/exe within a Bash ScriptWhy is CapEff all zeros in /proc/$PID/status
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am parsing process details out of /proc/PID
and I am so far unable to find who owns a process from that meta directory's files.
Documentation does not seem to point to that info as well:
linux
add a comment |
I am parsing process details out of /proc/PID
and I am so far unable to find who owns a process from that meta directory's files.
Documentation does not seem to point to that info as well:
linux
add a comment |
I am parsing process details out of /proc/PID
and I am so far unable to find who owns a process from that meta directory's files.
Documentation does not seem to point to that info as well:
linux
I am parsing process details out of /proc/PID
and I am so far unable to find who owns a process from that meta directory's files.
Documentation does not seem to point to that info as well:
linux
linux
edited Jul 14 '16 at 6:00
Dmitri Chubarov
11.6k3 gold badges26 silver badges56 bronze badges
11.6k3 gold badges26 silver badges56 bronze badges
asked Jul 14 '16 at 5:47
gextragextra
4,1646 gold badges28 silver badges50 bronze badges
4,1646 gold badges28 silver badges50 bronze badges
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
The owner of the process is the owner of all files in the /proc/PID
directory.
$ ls -l /proc/27595
total 0
dr-xr-xr-x 2 me users 0 Jul 14 11:53 attr
-r-------- 1 me users 0 Jul 14 11:53 auxv
...
Also the file /proc/PID/loginuid
holds the UID of the owner of the process.
$ cat /proc/27595/loginuid
1000
add a comment |
The owner of the files in /proc/[pid]/ is not always the user -- programs can e.g. make themselves "non-dumpable" to avoid leaking sensitive information if they become another user, and then the file ownership of the files in the directory can change to root.
But normally the UID of the process can be retrieved by an fstat call (or a stat command ) on the /proc/[pid] directory itself.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
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
);
);
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%2fstackoverflow.com%2fquestions%2f38366362%2fis-there-a-way-to-identify-the-user-who-owns-a-process-from-proc-pid%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
The owner of the process is the owner of all files in the /proc/PID
directory.
$ ls -l /proc/27595
total 0
dr-xr-xr-x 2 me users 0 Jul 14 11:53 attr
-r-------- 1 me users 0 Jul 14 11:53 auxv
...
Also the file /proc/PID/loginuid
holds the UID of the owner of the process.
$ cat /proc/27595/loginuid
1000
add a comment |
The owner of the process is the owner of all files in the /proc/PID
directory.
$ ls -l /proc/27595
total 0
dr-xr-xr-x 2 me users 0 Jul 14 11:53 attr
-r-------- 1 me users 0 Jul 14 11:53 auxv
...
Also the file /proc/PID/loginuid
holds the UID of the owner of the process.
$ cat /proc/27595/loginuid
1000
add a comment |
The owner of the process is the owner of all files in the /proc/PID
directory.
$ ls -l /proc/27595
total 0
dr-xr-xr-x 2 me users 0 Jul 14 11:53 attr
-r-------- 1 me users 0 Jul 14 11:53 auxv
...
Also the file /proc/PID/loginuid
holds the UID of the owner of the process.
$ cat /proc/27595/loginuid
1000
The owner of the process is the owner of all files in the /proc/PID
directory.
$ ls -l /proc/27595
total 0
dr-xr-xr-x 2 me users 0 Jul 14 11:53 attr
-r-------- 1 me users 0 Jul 14 11:53 auxv
...
Also the file /proc/PID/loginuid
holds the UID of the owner of the process.
$ cat /proc/27595/loginuid
1000
edited Jul 14 '16 at 6:00
answered Jul 14 '16 at 5:55
Dmitri ChubarovDmitri Chubarov
11.6k3 gold badges26 silver badges56 bronze badges
11.6k3 gold badges26 silver badges56 bronze badges
add a comment |
add a comment |
The owner of the files in /proc/[pid]/ is not always the user -- programs can e.g. make themselves "non-dumpable" to avoid leaking sensitive information if they become another user, and then the file ownership of the files in the directory can change to root.
But normally the UID of the process can be retrieved by an fstat call (or a stat command ) on the /proc/[pid] directory itself.
add a comment |
The owner of the files in /proc/[pid]/ is not always the user -- programs can e.g. make themselves "non-dumpable" to avoid leaking sensitive information if they become another user, and then the file ownership of the files in the directory can change to root.
But normally the UID of the process can be retrieved by an fstat call (or a stat command ) on the /proc/[pid] directory itself.
add a comment |
The owner of the files in /proc/[pid]/ is not always the user -- programs can e.g. make themselves "non-dumpable" to avoid leaking sensitive information if they become another user, and then the file ownership of the files in the directory can change to root.
But normally the UID of the process can be retrieved by an fstat call (or a stat command ) on the /proc/[pid] directory itself.
The owner of the files in /proc/[pid]/ is not always the user -- programs can e.g. make themselves "non-dumpable" to avoid leaking sensitive information if they become another user, and then the file ownership of the files in the directory can change to root.
But normally the UID of the process can be retrieved by an fstat call (or a stat command ) on the /proc/[pid] directory itself.
answered Mar 25 at 20:30
Alexis CouseinAlexis Cousein
261 bronze badge
261 bronze badge
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- 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%2fstackoverflow.com%2fquestions%2f38366362%2fis-there-a-way-to-identify-the-user-who-owns-a-process-from-proc-pid%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