<?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 Re: SFTP script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sftp-script/m-p/3373335#M195992</link>
    <description>Hi Muthu, &lt;BR /&gt;&lt;BR /&gt;I have tried already, but it didn't work. Is it because my version is 3.7? &lt;BR /&gt;&lt;BR /&gt;[root@sihp8012:/home/ap1030/aldo]&lt;BR /&gt;# ssh -V&lt;BR /&gt;OpenSSH_3.7.1p2, SSH protocols 1.5/2.0, OpenSSL 0.9.7c 30 Sep 2003&lt;BR /&gt;&lt;BR /&gt;Hi Michael, &lt;BR /&gt;Thanks alot for your help. The script is running well. I am considering to use the script, but I will try to find out how to encrypt expect script. Do you have the example how to do that, since I still can not find the link that you sent me. &lt;BR /&gt;&lt;BR /&gt;Thanks alot. &lt;BR /&gt;</description>
    <pubDate>Tue, 07 Sep 2004 05:09:39 GMT</pubDate>
    <dc:creator>Dewa Negara_4</dc:creator>
    <dc:date>2004-09-07T05:09:39Z</dc:date>
    <item>
      <title>SFTP script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sftp-script/m-p/3373331#M195988</link>
      <description>Hi All, &lt;BR /&gt;&lt;BR /&gt;Pls help. I am running the following script to transfer file using sftp. Everytime the script running, it's always prompting a password. It looks like the script ignores stdin. &lt;BR /&gt;&lt;BR /&gt;Is there anyway to prevent from prompting  a password wihthout generate public/private keys. &lt;BR /&gt;&lt;BR /&gt;Pls help. High score will be given. &lt;BR /&gt;&lt;BR /&gt;Thanks an Best Regards,&lt;BR /&gt;Negara&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 07 Sep 2004 03:38:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sftp-script/m-p/3373331#M195988</guid>
      <dc:creator>Dewa Negara_4</dc:creator>
      <dc:date>2004-09-07T03:38:25Z</dc:date>
    </item>
    <item>
      <title>Re: SFTP script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sftp-script/m-p/3373332#M195989</link>
      <description>So sorry forgot to attach the script. &lt;BR /&gt;&lt;BR /&gt;sftp ap1030@sihp8024 &amp;lt;&amp;lt;-EOF&lt;BR /&gt;&lt;PASSWORD&gt;&lt;BR /&gt;get test_file&lt;BR /&gt;bye&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;/PASSWORD&gt;</description>
      <pubDate>Tue, 07 Sep 2004 03:39:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sftp-script/m-p/3373332#M195989</guid>
      <dc:creator>Dewa Negara_4</dc:creator>
      <dc:date>2004-09-07T03:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: SFTP script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sftp-script/m-p/3373333#M195990</link>
      <description>Dewa,&lt;BR /&gt; &lt;BR /&gt; Did you make the setup of interactive sftp or not. We can not include the passwd of sftp in the command line without setting the ssh* on interactive setup.&lt;BR /&gt;&lt;BR /&gt; openssh 3.9 version is supporing rhosts with out any key after compromising the security and some setup issues there.&lt;BR /&gt;&lt;BR /&gt;Best way on this is to use RhostsRSAauthentication method for sftp. &lt;BR /&gt;&lt;BR /&gt;You are going to create one host key and put that key in the remote hosts known_hosts file with hostname.&lt;BR /&gt;&lt;BR /&gt;If you want to come out from sftp then use ftp easily as,&lt;BR /&gt;&lt;BR /&gt; ftp -i hostname -n &amp;lt;&amp;lt;-EOF 2&amp;gt;/dev/null&lt;BR /&gt;   open username passwd&lt;BR /&gt;   ls&lt;BR /&gt;   bye&lt;BR /&gt; EOF&lt;BR /&gt;&lt;BR /&gt;Without making interactive setup for s* commands we can not expect your requirement completion.&lt;BR /&gt;&lt;BR /&gt;And Refer this to setup s* commands not to look passwd with RhostsRASauthenticaiton as,&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.akadia.com/services/ssh_scp_without_password.html" target="_blank"&gt;http://www.akadia.com/services/ssh_scp_without_password.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;   &lt;BR /&gt;</description>
      <pubDate>Tue, 07 Sep 2004 04:02:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sftp-script/m-p/3373333#M195990</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-09-07T04:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: SFTP script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sftp-script/m-p/3373334#M195991</link>
      <description>If you are not concerned about periling your password,  expect script can easily do the job.&lt;BR /&gt;&lt;BR /&gt;Try the following,&lt;BR /&gt;&lt;BR /&gt;The following script will spawn sftp in batch mode. The password prompt will be taken care by the expect.&lt;BR /&gt;&lt;BR /&gt;#!/usr/local/bin/expect&lt;BR /&gt;&lt;BR /&gt;spawn  sftp  -b batchFile ap1030@sihp8024&lt;BR /&gt;expect "password:"&lt;BR /&gt;send "&lt;YOUR password=""&gt;\n";&lt;BR /&gt;interact&lt;BR /&gt;&lt;BR /&gt;your batchFile may contain&lt;BR /&gt;&lt;BR /&gt;get test_file&lt;BR /&gt;bye&lt;BR /&gt;&lt;BR /&gt;A one step level of security can be encrypting your expect script using gnupg so that your password will be concealed &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.gnupg.org/" target="_blank"&gt;http://www.gnupg.org/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;For more information on expect scripts &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://expect.nist.gov/" target="_blank"&gt;http://expect.nist.gov/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;A example of automating sftp using expect can be seen at the following link&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://linux-bsd-central.com/index.php/content/view/26/29/" target="_blank"&gt;http://linux-bsd-central.com/index.php/content/view/26/29/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;All the best&lt;/YOUR&gt;</description>
      <pubDate>Tue, 07 Sep 2004 04:11:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sftp-script/m-p/3373334#M195991</guid>
      <dc:creator>Michael Selvesteen_2</dc:creator>
      <dc:date>2004-09-07T04:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: SFTP script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sftp-script/m-p/3373335#M195992</link>
      <description>Hi Muthu, &lt;BR /&gt;&lt;BR /&gt;I have tried already, but it didn't work. Is it because my version is 3.7? &lt;BR /&gt;&lt;BR /&gt;[root@sihp8012:/home/ap1030/aldo]&lt;BR /&gt;# ssh -V&lt;BR /&gt;OpenSSH_3.7.1p2, SSH protocols 1.5/2.0, OpenSSL 0.9.7c 30 Sep 2003&lt;BR /&gt;&lt;BR /&gt;Hi Michael, &lt;BR /&gt;Thanks alot for your help. The script is running well. I am considering to use the script, but I will try to find out how to encrypt expect script. Do you have the example how to do that, since I still can not find the link that you sent me. &lt;BR /&gt;&lt;BR /&gt;Thanks alot. &lt;BR /&gt;</description>
      <pubDate>Tue, 07 Sep 2004 05:09:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sftp-script/m-p/3373335#M195992</guid>
      <dc:creator>Dewa Negara_4</dc:creator>
      <dc:date>2004-09-07T05:09:39Z</dc:date>
    </item>
    <item>
      <title>Re: SFTP script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sftp-script/m-p/3373336#M195993</link>
      <description>Hi Dewa,&lt;BR /&gt;&lt;BR /&gt;Nice to hear that your problem got solved.&lt;BR /&gt;&lt;BR /&gt;Regarding gnupg, It is an opensouce encryption tool based on PGP ( Pretty Good Privacy ). It is a public-key encryption application.&lt;BR /&gt;&lt;BR /&gt;You can get the source from &lt;A href="http://www.gnupg.org" target="_blank"&gt;http://www.gnupg.org&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Here it is in action: &lt;BR /&gt;&lt;BR /&gt;$ gpg -e &lt;OPTIONS&gt; my_secret_file.txt &lt;BR /&gt;&lt;BR /&gt;Once this is done a file called 'my_secret_file.txt.gpg' is created in your current directory. Any attempts to view the contents of this file will prove futile unless you encrypted it using your own Public Key. &lt;BR /&gt;&lt;BR /&gt;To decrypt it you simply use the -d switch followed by the encrypted file. &lt;BR /&gt;&lt;BR /&gt;$ gpg -d secret_file.txt.gpg &lt;BR /&gt;&lt;BR /&gt;Since you have your private key contained within your secret key ring GnuPG can determine whom 'secret_file.txt.gpg' was intended for and will decrypt it after you provide your passphrase.&lt;BR /&gt;&lt;BR /&gt;For more information refer the following link&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.technocage.com/~caskey/gnupg/pgp2gnupg.html" target="_blank"&gt;http://www.technocage.com/~caskey/gnupg/pgp2gnupg.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;/OPTIONS&gt;</description>
      <pubDate>Tue, 07 Sep 2004 06:45:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sftp-script/m-p/3373336#M195993</guid>
      <dc:creator>Michael Selvesteen_2</dc:creator>
      <dc:date>2004-09-07T06:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: SFTP script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sftp-script/m-p/3373337#M195994</link>
      <description>I'm curious.  If you're going to go to the trouble of using GPG and having to maintain a keyring, why not just use public key authentication in SFTP?  If the remote host supports SSH2 you can do the following:&lt;BR /&gt;&lt;BR /&gt;Use "ssh-keygen -t dsa" to generate the files $HOME/.ssh/id_dsa and $HOME/.ssh/id_dsa.pub.  Don't give it a passphrase (the script looks like it's going to be run unattended).&lt;BR /&gt;&lt;BR /&gt;Append the contents of id_dsa.pub to $HOME/.ssh/authorized_keys on the remote host.&lt;BR /&gt;&lt;BR /&gt;This will allow you to log on to ssh, scp and scp using public key authentication when you either specify the identity file (id_dsa), or when that file is in the current user's configured $HOME directory.&lt;BR /&gt;&lt;BR /&gt;Your script could change to:&lt;BR /&gt;&lt;BR /&gt;sftp ap1030@sihp8024 &amp;lt;&amp;lt;-EOF&lt;BR /&gt;get test_file&lt;BR /&gt;bye&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;or the equivalent:&lt;BR /&gt;&lt;BR /&gt;sftp ap1030@sihp8024:test_file&lt;BR /&gt;&lt;BR /&gt;I'd love to hear comments on this!&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Seth</description>
      <pubDate>Tue, 07 Sep 2004 20:04:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sftp-script/m-p/3373337#M195994</guid>
      <dc:creator>Seth Parker</dc:creator>
      <dc:date>2004-09-07T20:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: SFTP script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sftp-script/m-p/3373338#M195995</link>
      <description>If you exchange public keys between the servers, you can do it with scp and will not have to hard code a password into a script.&lt;BR /&gt;&lt;BR /&gt;I'm attaching instructions. They refer to X, you can do it with careful cat commands. Pay attention to directory permissions.&lt;BR /&gt;&lt;BR /&gt;Word doc.&lt;BR /&gt;Its in this thead. I can't find a copy here right now.&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=144612" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=144612&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Tue, 07 Sep 2004 21:14:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sftp-script/m-p/3373338#M195995</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2004-09-07T21:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: SFTP script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sftp-script/m-p/3373339#M195996</link>
      <description>Hi Michael, &lt;BR /&gt;&lt;BR /&gt;Thanks alot. I tried to install GPG on my test server using configure, make, make install and make clean respectively. But when I tried to run gpg, I got the error as below :&lt;BR /&gt;&lt;BR /&gt;[root@sihp8012:/tmp]&lt;BR /&gt;# gpg -e sftp&lt;BR /&gt;gpg: failed to create temporary file `/root/.gnupg/.#lk4000d3c0.sihp8012.9344': No such file or directory&lt;BR /&gt;gpg: keyblock resource `/root/.gnupg/secring.gpg': general error&lt;BR /&gt;gpg: failed to create temporary file `/root/.gnupg/.#lk4000d3c0.sihp8012.9344': No such file or directory&lt;BR /&gt;gpg: keyblock resource `/root/.gnupg/pubring.gpg': general error&lt;BR /&gt;You did not specify a user ID. (you may use "-r")&lt;BR /&gt;&lt;BR /&gt;Enter the user ID.  End with an empty line: 123456CA&lt;BR /&gt;No such user ID.&lt;BR /&gt;&lt;BR /&gt;Enter the user ID.  End with an empty line: ap1030&lt;BR /&gt;No such user ID.&lt;BR /&gt;&lt;BR /&gt;Enter the user ID.  End with an empty line:&lt;BR /&gt;gpg: no valid addressees&lt;BR /&gt;gpg: sftp: encryption failed: no such user id&lt;BR /&gt;&lt;BR /&gt;[root@sihp8012:/tmp]&lt;BR /&gt;# gpg sftp&lt;BR /&gt;gpg: failed to create temporary file `/root/.gnupg/.#lk4000d3c0.sihp8012.9345': No such file or directory&lt;BR /&gt;gpg: keyblock resource `/root/.gnupg/secring.gpg': general error&lt;BR /&gt;gpg: failed to create temporary file `/root/.gnupg/.#lk4000d3c0.sihp8012.9345': No such file or directory&lt;BR /&gt;gpg: keyblock resource `/root/.gnupg/pubring.gpg': general error&lt;BR /&gt;gpg: no valid OpenPGP data found.&lt;BR /&gt;gpg: processing message failed: eof&lt;BR /&gt;&lt;BR /&gt;Any idea what is wrong?&lt;BR /&gt;&lt;BR /&gt;Hi Seth, &lt;BR /&gt;Thanks alot for your great contribution. The main reason why we are not considering public/private keys is that the policy for the keys have not been established yet. So this just for temporary solution before using public/private keys. &lt;BR /&gt;&lt;BR /&gt;Hi Steven,&lt;BR /&gt;Thanks alot for answer. &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Sep 2004 00:10:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sftp-script/m-p/3373339#M195996</guid>
      <dc:creator>Dewa Negara_4</dc:creator>
      <dc:date>2004-09-08T00:10:20Z</dc:date>
    </item>
  </channel>
</rss>

