Jump to content

Hello, Everyone


G+_Ray Lorenz
 Share

Recommended Posts

Hello, Everyone. I am new to coding and I really have no experience. I was giving a task to find a script to ssh to 100 devices which basically ask for username and password and then run two commands. There is a lot of stuff on the internet.

What is best way accomplish this using perl, from a file with 100 IP addresses. Security is not an issue, putting the username and password in clear text is fine in the script. It is a one time run and not left on the machine.

 

Thanks for any help

Link to comment
Share on other sites

I assume this is a homework assignment? Nobody would run scripts this way in the real world. At worst you'd use SSH key based authentication, at best ansible or saltstack that are automation told meant four doing this sorry of work.

 

If you absolutely must do it the way you described, then I'd put the username and password in a csv file, and use Pearl to iterate through each line on the file.

Link to comment
Share on other sites

 Share

×
×
  • Create New...