If you want it to ask for the username and password at the start you might be better off with an expect script. There are many solutions to managing fleets of servers, heres my thoughts on a few:
- Some years ago I used
cluster ssh quite happily, it required a little hotkey remapping to prevent conflict with [ctrl]+ combos but was solid otherwise.
- I also used
puttycs when managing linux hosts from a windows pc, it was quite handy as you could create .cmd files with different sets of hosts.
- I've deployed
func in the past, which provides great control using globbing for hostnames and runs simultaneously rather than sequentially.
- You could also implement a configuration management system such as
puppet, it comes in open source or enterprise.
Configuration management is my current focus, it saves you having to work out who's been fiddling with what and why the system has stuff on it that you didn't put there.