I have a script that "barney" must run. He needs to retrieve some information from "fred''s account on the server via sftp.
Here is the code snipette:
Code:
# FTP data
echo "DOWNLOADING DATA..."
sftp fred@myserver << EOF
get $my_file
quit
EOF
I've configured "myserver" so that "fred" doesn't need to provide a password for ssh,scp,sftp,etc. The above code works as expected when ran as "fred" ... but I need to run the script as "barney". When the above code is ran as "barney" I have to provide "fred's" password each time.
Any ideas how can I run the above script as "barney" without having to provide "fred's" password each time?
-- Tony