Link to home
Start Free TrialLog in
Avatar of trinity12583
trinity12583

asked on

ksh secure copy (scp) - catch password prompt

I'm writing a korn shell script that includes automatic secure copying of a file to several servers.  If the current user is not configured for scp on the server, it will prompt for a password.  I'd like to catch this prompt and end the scp call if the prompt occurs.  Any help would be greatly appreciated!
ASKER CERTIFIED SOLUTION
Avatar of omarfarid
omarfarid
Flag of United Arab Emirates image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
i.g. ssh-keygen is the way to go
If that is not possible then expect will be best.
Avatar of trinity12583
trinity12583

ASKER

I was able to use the resources you gave to get a basic understanding ot Tcl and Expect and wrote a small script to accomplish what I needed in less than an hour!  Thanks so much!  :-)