I'm writing a script to automate the delivery of our code to different target environments and I was wondering if there's any way to cut down on the number of authentications that are needed. The script has to deliver to three different boxes (two directories on two boxes and one directory on the other) so it would be nice to only have to authenticate three times, one for each box. However, with the two separate directories on two of the boxes, I can't find a way to incorporate the different files from multiple local directories and the multiple remote directories into one command. Therefore, I have to single out each remote directory into multiple transactions, each of which requires a re-authentication.
I've managed to combine multiple files from different local directories to a single remote directory into one command but can't find a way to do it with multiple destination directories. I know it would just be easier to use sftp but the servers we're delivering to don't support ftp.
So, is there any way to do this while keeping the script interactive (i.e. not hard coding passwords into the script)? Any suggestions would be greatly appreciated.
Any reason you don't use public-key authentication? Then you just have to ssh-add the key once and then you won't be asked for passwords after that (or you could even create a passwordless key, if your guts and local policy allow).
One of the servers does use PK authentication but it still requires a passphrase to unlock the private key. The other two are strictly password-based and, unfortunately, the policy is not under our control.
Do they support ssh? If so then sftp is already built in. Sftp is part of ssh. No need for extra configuration, credentials, etc. If you can ssh to a box, you can sftp to a box with same credentials. What kind of boxes are they?
They do support SSH but the FTP doesn't support interaction. When I tried to write a batch file and call it with
it says:
Quote:
FATAL: ssh client failed to authenticate. (or you have too old ssh installed, check with ssh -v)
In other words, I didn't want to hard-code the password into the script so I basically had:
in the batch file and it failed executing the first command. I also tried using expect to "watch" my session and that didn't work either. Unfortunately, scp seems like the only thing that is script-able.
Generate your PK file with an empty passphrase. This will serve for your automation requirement..although it also has the dubious "keys to the kingdom" distinction.
Reading replies to questions, as an amateur, I have learnt a lot from you pros on here.
The shell in any of its guises is serioulsy poweful.
With so many transient and resident commands at one's disposal is there anything,
non-GUI, that cannot be done inside a default shell and terminal?
... (12 Replies)
I use a simple script to do some quantum calculations with gaussian package. the script as follows
#!/bin/sh
#put a gaussian input file into a new folder in the same name
#and submit this new job
for i in *.gjf
do
FN=$( echo $i | sed 's/.gjf//')
mkdir $FN
mv... (1 Reply)
Look We all know that Linux is almost BulletProof and about 40% faster than Win2K3 Server, When running Oracle DB, Right?
Now my Question is can OS X run just as Well as Linux as a Server being PowerPC and Whatever, Can it be just as stable?
Now You Tell me, Which is most Practical:
Linux... (3 Replies)