Ok, i don't know if anyone else here have had to deal with something like this before, but here's my situation.
I have about 1000+ servers I need to log into to do something.
What i need to do is to log into each server, go to a certain directory on each of the servers, copy the files that are in that directory to the local server where the Expect script is being kicked off from.
I have not the slightest idea where to start on this. Can someone please help?
I already installed the expect program on my server.
The operating system of the local server is Ubuntu 8.04.
ssh key auths is totally out of the question, for security reasons. The files do live in the same directory on all of the servers. An expect script is pretty much the only way that can accomplish what I need.
Pretty much what i need to do is this:
Log into a remote system
run a sudo command (which will obviously prompt me for a password)
the sudo command will change permissions of the files in the directory.
the sudo command will then copy the files in the directory to my home directory on that same remote system.
Log out of the system and repeat the same process for each server.
well, then, if you're forced to use a password, the first thing you do is write the expect script to do NOTHING but log into the other system, then log out.
once you have that, then you fill in the middle with the other stuff you want to do.