LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 03-07-2014, 11:39 AM   #1
amdjml
LQ Newbie
 
Registered: Mar 2014
Posts: 2

Rep: Reputation: Disabled
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?

Any help is much appreciated.
 
Old 03-07-2014, 11:48 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by amdjml View Post
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.
 
Old 03-07-2014, 11:58 AM   #3
amdjml
LQ Newbie
 
Registered: Mar 2014
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TB0ne View Post
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.
 
Old 03-08-2014, 07:41 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
These might help
http://rute.2038bug.com/index.html.gz
http://wiki.bash-hackers.org/syntax/start
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Please Help: IE and Sikuli/Linux Virtual Machines smedina25 Linux - Virtualization and Cloud 9 07-12-2012 12:03 PM
Question Shell script to shutdown virtual machines. copy, and than start VM simmouk87 Linux - General 3 03-20-2011 03:51 PM
Virtual Machines with Linux techadventures Linux - Server 4 06-28-2009 03:18 AM
Connect two virtual linux machines via virtual USB or serial WebBeing Linux - General 4 07-22-2008 07:26 AM
Installing Linux on virtual machines Delmarc Linux - Newbie 2 08-26-2003 04:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration