<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Script - SFTP for file transfer in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-sftp-for-file-transfer/m-p/5189117#M461272</link>
    <description>Hi,&lt;BR /&gt;I want to write a script for file transfer using sftp. I want to automate this script so that at schedule time the script will run and transfer the file. I am already having a script for ftp to transfer the file. &lt;BR /&gt;HOST='xxxx.host.com'&lt;BR /&gt;USER='abcd'&lt;BR /&gt;PASSWD='xxxx'&lt;BR /&gt;/usr/bin/ftp -nv $HOST &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;user $USER $PASSWD&lt;BR /&gt;mput *.txt&lt;BR /&gt;EOF&lt;BR /&gt;How can i modify this script for sftp...so that the script can automatically login to there sftp server without asking me for the password. As i have already the password of there sftp server. I am able to connect there sftp server manually.I want to do this task through script.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Narendra</description>
    <pubDate>Thu, 23 Jul 2009 09:27:50 GMT</pubDate>
    <dc:creator>Narendra Uttekar</dc:creator>
    <dc:date>2009-07-23T09:27:50Z</dc:date>
    <item>
      <title>Script - SFTP for file transfer</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-sftp-for-file-transfer/m-p/5189117#M461272</link>
      <description>Hi,&lt;BR /&gt;I want to write a script for file transfer using sftp. I want to automate this script so that at schedule time the script will run and transfer the file. I am already having a script for ftp to transfer the file. &lt;BR /&gt;HOST='xxxx.host.com'&lt;BR /&gt;USER='abcd'&lt;BR /&gt;PASSWD='xxxx'&lt;BR /&gt;/usr/bin/ftp -nv $HOST &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;user $USER $PASSWD&lt;BR /&gt;mput *.txt&lt;BR /&gt;EOF&lt;BR /&gt;How can i modify this script for sftp...so that the script can automatically login to there sftp server without asking me for the password. As i have already the password of there sftp server. I am able to connect there sftp server manually.I want to do this task through script.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Narendra</description>
      <pubDate>Thu, 23 Jul 2009 09:27:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-sftp-for-file-transfer/m-p/5189117#M461272</guid>
      <dc:creator>Narendra Uttekar</dc:creator>
      <dc:date>2009-07-23T09:27:50Z</dc:date>
    </item>
    <item>
      <title>Re: Script - SFTP for file transfer</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-sftp-for-file-transfer/m-p/5189118#M461273</link>
      <description>Hi Narendra, &lt;BR /&gt;&lt;BR /&gt;Main Script&lt;BR /&gt;-------------&lt;BR /&gt;&lt;BR /&gt;HOST='xxxx.host.com'&lt;BR /&gt;USER='abcd'&lt;BR /&gt;PASSWD='xxxx'&lt;BR /&gt;sftp -b &lt;BATCHFILE&gt; ${USER}@${HOST}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Authentication:&lt;BR /&gt;---------------&lt;BR /&gt;On Local box run 'ssh-keygen -t dsa' to generate private and pub keys copy the public key to remote box in '~user/.ssh/authorized_keys'with cat command&lt;BR /&gt;&lt;BR /&gt;Batchfile:&lt;BR /&gt;----------&lt;BR /&gt;cd &lt;REMOTE target="" dir=""&gt;&lt;BR /&gt;mput *.txt&lt;BR /&gt;&lt;BR /&gt;Tested OK. &lt;BR /&gt;Hope this will help you&lt;BR /&gt;&lt;BR /&gt;Prashant&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/REMOTE&gt;&lt;/BATCHFILE&gt;</description>
      <pubDate>Thu, 23 Jul 2009 10:29:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-sftp-for-file-transfer/m-p/5189118#M461273</guid>
      <dc:creator>Prashantj</dc:creator>
      <dc:date>2009-07-23T10:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: Script - SFTP for file transfer</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-sftp-for-file-transfer/m-p/5189119#M461274</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;As you see sftp works in a pretty similar way to ftp scripting.&lt;BR /&gt;&lt;BR /&gt;The bad part is the script has to have a password hard coded.&lt;BR /&gt;&lt;BR /&gt;There is a better way.&lt;BR /&gt;&lt;BR /&gt;Public Key authentication. Works for ssh,scp,sftp&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.hpux.ws/?p=10" target="_blank"&gt;http://www.hpux.ws/?p=10&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The parent site also has a trick for forcing public key authentication only, to stop random script kiddie authentication guessing.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Thu, 23 Jul 2009 10:54:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-sftp-for-file-transfer/m-p/5189119#M461274</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2009-07-23T10:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: Script - SFTP for file transfer</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-sftp-for-file-transfer/m-p/5189120#M461275</link>
      <description>Hi Narendra,&lt;BR /&gt;&lt;BR /&gt;First you should configure ssh password less login for that user between source and destination server to automate the sftp script.&lt;BR /&gt;&lt;BR /&gt;Once you  configured the password less login you can schedule a simple script like this to do the job.&lt;BR /&gt;&lt;BR /&gt;#--------------------------------------------&lt;BR /&gt;# Connect to remote server and put the files&lt;BR /&gt;#--------------------------------------------&lt;BR /&gt;sftp remoteuser@10.0.0.100 &amp;lt;&amp;lt;**&lt;BR /&gt;lcd /data/files&lt;BR /&gt;put filename.txt&lt;BR /&gt;**&lt;BR /&gt;#--------------------------------------------&lt;BR /&gt;&lt;BR /&gt;You can also refer this link for how to generate the public key and sftp script.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1310366" target="_blank"&gt;http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1310366&lt;/A&gt;</description>
      <pubDate>Thu, 23 Jul 2009 11:07:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-sftp-for-file-transfer/m-p/5189120#M461275</guid>
      <dc:creator>Ganesan R</dc:creator>
      <dc:date>2009-07-23T11:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: Script - SFTP for file transfer</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-sftp-for-file-transfer/m-p/5189121#M461276</link>
      <description>If you're using 'sftp' then you have the SSH protocols.&lt;BR /&gt;&lt;BR /&gt;As the user (on your side) that is to connect create your keys to transfer to the other server.  Run:&lt;BR /&gt;ssh-keygen -t &lt;RSA or="" dsa=""&gt; &lt;BR /&gt;&lt;BR /&gt;It will create a private key &amp;amp; a public key (id_rsa.pub for example) under the user the .ssh directory.  It will create that directory if it doesn't exist.&lt;BR /&gt;&lt;BR /&gt;Now...take that id_rsa.pub key file and send that over to the other server.  If you control this remote server, then just put it in the user on that box account in the .ssh directory.&lt;BR /&gt;If it's a box you don't control, contact them to make arrangements to get the file there.  I don't recommend email, cause sometimes the file corrupts.  Send it ftp &lt;BINARY&gt;.  The folks on that side can add the key.  &lt;BR /&gt;&lt;BR /&gt;The first time you make the connection you will have to respond "yes", depending on the other side you will likely the first time have to give the password.  This updates and accepts the new keys. &lt;BR /&gt;From this point on you should be go and not require a password again.  Whic means.........no password in your script!&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;Rita&lt;BR /&gt;&lt;/BINARY&gt;&lt;/RSA&gt;</description>
      <pubDate>Thu, 23 Jul 2009 11:13:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-sftp-for-file-transfer/m-p/5189121#M461276</guid>
      <dc:creator>Rita C Workman</dc:creator>
      <dc:date>2009-07-23T11:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: Script - SFTP for file transfer</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-sftp-for-file-transfer/m-p/5189122#M461277</link>
      <description>Hi,&lt;BR /&gt;I know the ssh for password less authenticaition by generating the keys. But what i am looking is i am already having the password for sftp connection to there server. I can manually connect to there server. But i want to do the sftp file transfer through script for automation. &lt;BR /&gt;I have searched on google...some-one was reffering for the except, Is anyone have done the scripting for sftp file transfer with except, Please let me know the procedure.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Narendra</description>
      <pubDate>Fri, 24 Jul 2009 04:34:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-sftp-for-file-transfer/m-p/5189122#M461277</guid>
      <dc:creator>Narendra Uttekar</dc:creator>
      <dc:date>2009-07-24T04:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: Script - SFTP for file transfer</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-sftp-for-file-transfer/m-p/5189123#M461278</link>
      <description>Hi,&lt;BR /&gt;I have installed the 3 software &lt;BR /&gt;expect-5.43-hppa-11.11.depot&lt;BR /&gt;libXft-2.1.13-hppa-11.11.depot&lt;BR /&gt;tcltk-8.5.7-hppa-11.11.depot&lt;BR /&gt;&lt;BR /&gt;and modified the script to use expect for interactive response to answer...&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Narendra</description>
      <pubDate>Fri, 24 Jul 2009 06:02:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-sftp-for-file-transfer/m-p/5189123#M461278</guid>
      <dc:creator>Narendra Uttekar</dc:creator>
      <dc:date>2009-07-24T06:02:09Z</dc:date>
    </item>
  </channel>
</rss>

