1834912 Members
3167 Online
110071 Solutions
New Discussion

Script help

 
Anthony khan
Frequent Advisor

Script help

Hi Guys,

Anyone using sftp in the script to transfer files or some one have an idea how to use sftp in script, like how to pass password in script.


Thanks
Anthony
2 REPLIES 2
Steven E. Protter
Exalted Contributor

Re: Script help

Here is how to do it in regular ftp

ftp -v -n <open myserver.com
user username password
cd /somedir
lcd localhost/mydirectory
put filename
EOF


Since however you are using Secure FTP that means you have the openssh tools.

The attached document tells you how to generate and exchange public keys. This will allow you to safely and securely do scp commands without needing a password.

See attached word doc.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Karthik S S
Honored Contributor

Re: Script help

Hi,

It is not possible to pass the password through the script for sftp/stelnet. However you can use "Expect" tool to automate this. For more info refer to my previous postings,

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=45609

-Karthik S S
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn