I want to get the user_id of a specific user on an AWS instance. I can get this information from /etc/passwd file. but i want to get this information in a python script. Is there any way to get this information?
Asked
Active
Viewed 39 times
0
-
1Possible duplicate of [Python script to list users and groups](http://stackoverflow.com/questions/421618/python-script-to-list-users-and-groups) – Frederic Henri Dec 15 '15 at 09:13
-
@FrédéricHenri I want to get this info for some aws instances, not for my local machine. – Rahul Kumar Dec 15 '15 at 09:24
-
you can run this script on the EC2 instance, do you need to run it locally pinging the EC2 instance ? – Frederic Henri Dec 15 '15 at 09:30
-
@FrédéricHenri i need user_id for more than one instances, how can i get the info for all from my local machine? – Rahul Kumar Dec 15 '15 at 09:33
-
@FrédéricHenri is the any way using boto to get user_id for instances. – Rahul Kumar Dec 15 '15 at 09:34
-
1If you need to get the user account on the EC2 instances, boto will not help and you'll need the script I referenced - If you need the IAM account, yes you'll use boto – Frederic Henri Dec 15 '15 at 09:40