Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
August 16, 2005, 6:47 pm
rate this thread
Here is my problem:
I have my one client with the private key and numerous servers with the
public key. Key authentication works fine.
I have a Korn Shell Script that SCPs a file from the client to each of
the servers' home directory in the middle of the night. Here is the
line that does the copy:
scp -i PrivateKeyFile /home/chad/file.txt username@server:~/
This works absolutely fine.
Now I am adding new servers every day. What if I forget to copy the
public key to one of the servers? or something else with the connection
goes wrong? Answer: SCP will prompt for a password and my script will
hang in the middle of the night.
I would much rather prefer my script to write to an error log, then
continue with its business.
Any ideas on how I can get my script to deal with the password prompt?
Thanks a lot! ~ Chad
Re: Have Script Deal with SSH/SCP password Prompt
-o BatchMode=yes (or put it in a config file used by that scp).
If set to ``yes'', passphrase/password querying will be disabled.
This option is useful in scripts and other batch jobs where no
user is present to supply the password. The argument must be
``yes'' or ``no''. The default is ``no''.
Darren Dunham firstname.lastname@example.org
Senior Technical Consultant TAOS http://www.taos.com /
Got some Dr Pepper? San Francisco, CA bay area
< This line left intentionally blank to confuse you. >
- Stein Arne Storslett
August 17, 2005, 5:47 am
- » ssh on command line: force using a group size (prime size) of 1024 (and no...
- — Newest thread in » Secure Shell Forum