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;








1















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:










share|improve this question






























    1















    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:










    share|improve this question


























      1












      1








      1








      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:










      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      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






















          2 Answers
          2






          active

          oldest

          votes


















          2














          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





          share|improve this answer
































            0














            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.






            share|improve this answer

























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



              );













              draft saved

              draft discarded


















              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









              2














              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





              share|improve this answer





























                2














                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





                share|improve this answer



























                  2












                  2








                  2







                  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





                  share|improve this answer















                  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






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  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























                      0














                      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.






                      share|improve this answer



























                        0














                        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.






                        share|improve this answer

























                          0












                          0








                          0







                          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.






                          share|improve this answer













                          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.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Mar 25 at 20:30









                          Alexis CouseinAlexis Cousein

                          261 bronze badge




                          261 bronze badge



























                              draft saved

                              draft discarded
















































                              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.




                              draft saved


                              draft discarded














                              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





















































                              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

                              Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                              Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                              Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript