in reply to Re^2: parse /etc/passwd and output it as csv in hundred servers
in thread parse /etc/passwd and output it as csv in hundred servers
Hello again garcimo,
Sorry for the late reply but I got busy and I missed your reply. Let's go through line by line what you said.
I do not use 190 different password.. just one that can connect to all the servers
I do not know if you use WindowsOS but in case you are using LinuxOS I would create a script and do the following (pseudo code):
#!/usr/bin/perl use Expect; use strict; use warnings; my @devices = ("127.0.0.1", "localhost"); my $command = 'ssh'; my @params = ('-p', 22); # These is to bypass the prompt of each node for new ssh connection. foreach my $device (@devices) { # create an Expect object by spawning another process push @params, $device; my $exp = Expect->spawn($command, @params); $exp->send("yes"); } # Second step do the same with ssh-copy-id (ssh keys) # You said that all nodes share the same password so it should be very + easy to create ssh keys for all nodes from the main node.
The idea of the script is to bypass the ssh prompt on all nodes and then create ssh keys on all nodes. See also relevant question SSH - Key Authentication for more information on that.
After that it is upon you if you want to capture the output of each node on different file stored in specific dir or append each node on one file.
If in any case my description is complicated comment under and I will try to reply with more details on the part that you do not understand.
Hope this helps, BR
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: parse /etc/passwd and output it as csv in hundred servers
by garcimo (Novice) on Apr 16, 2018 at 11:17 UTC | |
by thanos1983 (Parson) on Apr 16, 2018 at 21:01 UTC |