Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to Use Password for sftp in shell script with password

User469306-OCJun 15 2016 — edited Jun 24 2016

Hi All,

Good Morning.

I have requirement to pass the Password for SFTP in shell scripts.

Below is my script - TEST.sh

v_nassup_ip="\"ProxyCommand /usr/bin/ncat --proxy-type http --proxy ashsproxy.amers.ibechtel.com:8080 %h %p\" toscorp@132.xx.xxx.xx:"

v_nassup_password="xxxxxxxxxxxxxxxx"

file_name="TOS_CORP_INVOICE_DATA~06-09-2016.dat"

echo servername=$v_nassup_ip

echo password=$v_nassup_password

echo

sftp -o "ProxyCommand /usr/bin/ncat --proxy-type http --proxy ashsproxy.amers.ibechtel.com:8080 %h %p" toscorp@132.xx.xxx.xx: << EOF

"xxxxxxxxxxxxxx"

cd test/out

size $file_name

bye

EOF

This is not working when i ran the script it is prompting again PASSWORD.

Could you please help on this requirement.

Thanks and Regards,

Nageshwar Reddy Porla.

[ Moderator Action (BluShadow) - Public IP address and password removed to protect security - Please do not post security details on the public internet - doing so could cost you your job ]

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 22 2016
Added on Jun 15 2016
5 comments
15,837 views