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

                              How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

                              155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

                              Convert JSON to MapSimplest way to convert a string representing JSON array into Java array List of key value pairsHow to take String JSON values into HashMapConvert a JSON String to a HashMapCreating BSON object from JSON stringJSONObject - How to get a value ?Better Map ConstructorReading JSON from Url javaUpdate columns if input values are not null otherwise ignore and keep the existing values of column in databaseHow to store object represented as Json string into Couchbase Lite?Go JSON into MapHow do I efficiently iterate over each entry in a Java Map?Sort a Map<Key, Value> by valuesHow to round a number to n decimal places in JavaCan comments be used in JSON?How do I read / convert an InputStream into a String in Java?How can I pretty-print JSON in a shell script?What is the correct JSON content type?How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?Why does Google prepend while(1); to their JSON responses?Parse JSON in JavaScript?