Script to retrieve users from couple linux virtual machines
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Script to retrieve users from couple linux virtual machines
Hi there linux community,
At home, I have setup a esxi server on an old desktop of mine. I have then installed about 5 virtual machines, which is a combination of debian and ubuntu and each box has about 3-7 users.
My question is, how can I write a script/a command that will go through my network, find these linux servers and extract the usernames from each and report it back to me?
Is this something can be easily achieved or do I need to know scripting in details?
Hi there linux community,
At home, I have setup a esxi server on an old desktop of mine. I have then installed about 5 virtual machines, which is a combination of debian and ubuntu and each box has about 3-7 users.
My question is, how can I write a script/a command that will go through my network, find these linux servers and extract the usernames from each and report it back to me? Is this something can be easily achieved or do I need to know scripting in details?
Your question seems to answer itself. If you want to write a script, you would very obviously need to know HOW to write scripts. You would need to ssh to each system, and probably use cat to look at the /etc/passwd file.
There are MANY easily-found scripting tutorials, and scripts already exist to list users...a Google search can turn up lots. Come back and post what you've written/tried, and where you're stuck. But this isn't the place to come and have people write scripts for you.
Your question seems to answer itself. If you want to write a script, you would very obviously need to know HOW to write scripts. You would need to ssh to each system, and probably use cat to look at the /etc/passwd file.
There are MANY easily-found scripting tutorials, and scripts already exist to list users...a Google search can turn up lots. Come back and post what you've written/tried, and where you're stuck. But this isn't the place to come and have people write scripts for you.
Thank you for your comment. Perhaps my comment was a bit vague, I was not expecting anyone to write the script for me, but rather point me to a direction and the logic behind doing something like that. I will look into your suggestion.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.