I need to copy two programs from one server to another after compiling using an automated non-interactive python script. Keys are not an option as this script is for multiple users on company servers and both keys and passwords are required. Passwords are not being stored in the program, but are being asked once at the start of the program using getpass(), and then used for both SCP transfers so that the user doesn't have to enter their password for each scp call. I'm using os.system to call scp:
os.system("/usr/bin/scp %s %s@server:directory" %(prg, uname))
os.system("/usr/bin/scp %s %s@server:directory2" %(prg2, uname))
scp is defined for another program, thus /usr/bin/scp. prg/prg2 is the program's location and uname is the users username on the remote server(s).
I tried piping the password, like described here, however it did not work.
I can't install sshpass, expect, paramiko, or fabric, and I can't use rsync b/c it isn't installed on the receiving server. Is there anything that I can do to automate this?
I'm running AIX 6.1, Python 2.6.2
UPDATE: I can't install external libraries, such as pexpect, either because AIX doesn't have a /config folder in the python install directory. A fix for that is to install python-devel for AIX, but I can't install program, so I'm still stuck.
UPDATE 2: I decided to forgo SCP in favor of FTP. I used a combination of this and this to make my FTP script. Thanks for your answers and helping guide me.