Dear tribesmen, help to collect a script that:
1) It will create on all available hosts in the range user foo with a random password(the password must be different everywhere and contain letters of different register + numbers + special characters).
2) Write the information to a local file, which will contain the IP and password of the account foo.

The main problem is how to make the script call all hosts? Obviously, there is a simple solution to this commonplace question.
Thanks in advance!

4 Answers 4

And where does the script?

You need to start all available hosts set up for a login with admin to create users.
Well, if you set up all the available hosts, then you create a list of hosts in the process, which means you can simply put this list of hosts into an array or file with a regular for for it to run.

Generating a random string is a thing, for example like this:
dd if=/dev/urandom bs=10 count=1 status=noxfer 2>/dev/null | base64
In shaggy times, when I put the server, a pseudo-user had to start on it and the ssh-key of my central pseudo-user dropped to it so that the script could go to the server list and execute any command I needed.
Just make a loop