{"id":2139,"date":"2019-05-18T13:00:03","date_gmt":"2019-05-18T12:00:03","guid":{"rendered":"https:\/\/chewett.co.uk\/blog\/?p=2139"},"modified":"2019-05-22T22:31:17","modified_gmt":"2019-05-22T21:31:17","slug":"how-to-get-linux-user-information-from-a-user-id","status":"publish","type":"post","link":"https:\/\/chewett.co.uk\/blog\/2139\/how-to-get-linux-user-information-from-a-user-id\/","title":{"rendered":"How to get Linux user information from a User ID"},"content":{"rendered":"\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"678\" height=\"254\" data-attachment-id=\"2145\" data-permalink=\"https:\/\/chewett.co.uk\/blog\/2139\/how-to-get-linux-user-information-from-a-user-id\/get_linx_user_info_from_userid\/\" data-orig-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/04\/get_linx_user_info_from_userid.jpg?fit=800%2C300&amp;ssl=1\" data-orig-size=\"800,300\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"get_linx_user_info_from_userid\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/04\/get_linx_user_info_from_userid.jpg?fit=300%2C113&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/04\/get_linx_user_info_from_userid.jpg?fit=678%2C254&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/04\/get_linx_user_info_from_userid.jpg?resize=678%2C254&#038;ssl=1\" alt=\"\" class=\"wp-image-2145\" srcset=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/04\/get_linx_user_info_from_userid.jpg?w=800&amp;ssl=1 800w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/04\/get_linx_user_info_from_userid.jpg?resize=300%2C113&amp;ssl=1 300w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/04\/get_linx_user_info_from_userid.jpg?resize=768%2C288&amp;ssl=1 768w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/04\/get_linx_user_info_from_userid.jpg?resize=50%2C19&amp;ssl=1 50w\" sizes=\"auto, (max-width: 678px) 100vw, 678px\" \/><\/figure>\n\n\n\n<p>This blog post talks about how you can get user information from a Linux User ID.<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">How to get Linux user information from a User ID<\/h2>\n\n\n\n<p>Sometimes you may only have a unix user ID and want to the user information. To accomplish this I am going to use the <code>getent<\/code> command. This goes through admin databases to find information about the user.<\/p>\n\n\n\n<p>To find the details of a user from their user ID you can use the passwd database.<\/p>\n\n\n\n<p>This can be accomplished using the following command.<\/p>\n\n\n\n<p>getent passwd THEUSERID<\/p>\n\n\n\n<p>Running this will return the user details from the passwd file. This includes information such as their shell, username and group ids.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This blog post talks about how you can get user information from a Linux User ID.<\/p>\n","protected":false},"author":1,"featured_media":2150,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[5],"tags":[39],"class_list":["post-2139","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-informational","tag-linux"],"wppr_data":{"cwp_meta_box_check":"No"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/04\/user_information_from_id_linux.jpg?fit=800%2C800&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p2toWX-yv","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":521,"url":"https:\/\/chewett.co.uk\/blog\/521\/add-new-user-account-raspbian-raspberry-pi\/","url_meta":{"origin":2139,"position":0},"title":"Add a new user account in Raspbian Raspberry Pi","author":"Chewett","date":"August 5, 2017","format":false,"excerpt":"For my cluster project I will add a new user to each Raspberry Pi. This is so the user I use for all other systems will be the \u00a0same on the Raspberry Pi's. This post describes how to add another user to Raspbian OS. Adding a new user to Raspbian\u2026","rel":"","context":"In &quot;Raspberry Pi Cluster&quot;","block_context":{"text":"Raspberry Pi Cluster","link":"https:\/\/chewett.co.uk\/blog\/category\/raspberry-pi-cluster\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/08\/add_user_to_raspbian_os.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/08\/add_user_to_raspbian_os.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/08\/add_user_to_raspbian_os.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/08\/add_user_to_raspbian_os.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":375,"url":"https:\/\/chewett.co.uk\/blog\/375\/setting-up-the-ci20-for-the-cluster\/","url_meta":{"origin":2139,"position":1},"title":"Setting up the CI20 for the cluster","author":"Chewett","date":"October 27, 2018","format":false,"excerpt":"This post talks about the steps I have followed to set up my Creator CI20 for the Raspberry Pi Cluster. Burning Debian to the onboard NAND and configuring it To run the CI20 on the Raspberry Pi Cluster I am going to write Debian 8 to the NAND storage. First\u2026","rel":"","context":"In &quot;Raspberry Pi Cluster&quot;","block_context":{"text":"Raspberry Pi Cluster","link":"https:\/\/chewett.co.uk\/blog\/category\/raspberry-pi-cluster\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/10\/ci40_setup.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/10\/ci40_setup.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/10\/ci40_setup.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/10\/ci40_setup.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":241,"url":"https:\/\/chewett.co.uk\/blog\/241\/installing-raspbian-onto-raspberry-pi\/","url_meta":{"origin":2139,"position":2},"title":"Installing Raspbian onto a Raspberry Pi","author":"Chewett","date":"May 17, 2017","format":false,"excerpt":"Here I suggest some recommended steps to install Raspbian on top of their install guide. Choosing an OS for the Raspberry Pi One of the main ways to install a Raspberry Pi OS is to download a disk image called NOOBS.\u00a0This lets you\u00a0choose to easily install a number of different\u2026","rel":"","context":"In &quot;Raspberry Pi Cluster&quot;","block_context":{"text":"Raspberry Pi Cluster","link":"https:\/\/chewett.co.uk\/blog\/category\/raspberry-pi-cluster\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":997,"url":"https:\/\/chewett.co.uk\/blog\/997\/installing-dropbox-fedora-27-xfce\/","url_meta":{"origin":2139,"position":3},"title":"Installing Dropbox on Fedora 27 XFCE","author":"Chewett","date":"February 7, 2018","format":false,"excerpt":"This blog post describes how you can install Dropbox on Fedora 27 XFCE. Installing pre-requisite packages Before we can install Dropbox we need to install a number of pre-requisite packages. The full command to install the required packages is: sudo\u00a0dnf\u00a0install\u00a0libgnome\u00a0nautilus-extensions python-gpgme The first two packages, libgnome\u00a0and\u00a0nautilus-extensions, are required by the\u2026","rel":"","context":"In &quot;Software&quot;","block_context":{"text":"Software","link":"https:\/\/chewett.co.uk\/blog\/category\/software\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/02\/installing_dropbox_on_fedora.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/02\/installing_dropbox_on_fedora.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/02\/installing_dropbox_on_fedora.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/02\/installing_dropbox_on_fedora.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":153,"url":"https:\/\/chewett.co.uk\/blog\/153\/add-user-group-linux\/","url_meta":{"origin":2139,"position":4},"title":"Add a user to a group in Linux","author":"Chewett","date":"September 2, 2013","format":false,"excerpt":"How to add a user to a group in Linux usermod -a -G Its a simple as that. So for me adding the user \"chewett\" to the user \"vboxusers\" i run the command usermod -a -G vboxusers chewett The -a flag means that the new group is appended, without it\u2026","rel":"","context":"In &quot;Informational&quot;","block_context":{"text":"Informational","link":"https:\/\/chewett.co.uk\/blog\/category\/informational\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":572,"url":"https:\/\/chewett.co.uk\/blog\/572\/installing-ubuntu-linux-tools-windows\/","url_meta":{"origin":2139,"position":5},"title":"Installing Ubuntu Linux tools for Windows","author":"Chewett","date":"August 23, 2017","format":false,"excerpt":"I am a big fan of Linux and today want to share how you can install the Windows Subsystem for Linux (WSL) on Windows 10. This new feature available in Windows 10 lets you install a Linux bash shell and run various linux tools on Windows. Here I describe how\u2026","rel":"","context":"In &quot;Informational&quot;","block_context":{"text":"Informational","link":"https:\/\/chewett.co.uk\/blog\/category\/informational\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/08\/windows_subsystem_for_linx.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/08\/windows_subsystem_for_linx.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/08\/windows_subsystem_for_linx.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/08\/windows_subsystem_for_linx.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/2139","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=2139"}],"version-history":[{"count":4,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/2139\/revisions"}],"predecessor-version":[{"id":2205,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/2139\/revisions\/2205"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/media\/2150"}],"wp:attachment":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=2139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=2139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=2139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}