<?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 using expect script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sftp-using-expect-script/m-p/3375368#M747321</link>
    <description>Hi Geoff / Harry, &lt;BR /&gt;&lt;BR /&gt;Thanks. &lt;BR /&gt;&lt;BR /&gt;Will the crtificate be able to avoid hard-coded passord?&lt;BR /&gt;&lt;BR /&gt;What is the steps do configure the certificate? Sorry because this is really new for me. &lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;Negara</description>
    <pubDate>Thu, 09 Sep 2004 21:51:37 GMT</pubDate>
    <dc:creator>Dewa Negara_4</dc:creator>
    <dc:date>2004-09-09T21:51:37Z</dc:date>
    <item>
      <title>SFTP using expect script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sftp-using-expect-script/m-p/3375365#M747318</link>
      <description>Hi All, &lt;BR /&gt;&lt;BR /&gt;I am running SFTP using expect script below :&lt;BR /&gt;&lt;BR /&gt;#!/usr/local/bin/expect&lt;BR /&gt;spawn sftp -b batchFile &lt;USER&gt;@&lt;REMOTEHOSTS&gt;&lt;BR /&gt;expect "password:"&lt;BR /&gt;send "&lt;PASSWORD&gt;\n";&lt;BR /&gt;interact&lt;BR /&gt;&lt;BR /&gt;Is there any way how to prevent from hard-code the password in the script? Can we hidden the password? I just want to mitigate the security risk for the script. &lt;BR /&gt;&lt;BR /&gt;Pls help. High score will be given. &lt;BR /&gt;&lt;BR /&gt;Thanks and Best Regards,&lt;BR /&gt;Negara&lt;BR /&gt;&lt;BR /&gt;&lt;/PASSWORD&gt;&lt;/REMOTEHOSTS&gt;&lt;/USER&gt;</description>
      <pubDate>Thu, 09 Sep 2004 03:29:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sftp-using-expect-script/m-p/3375365#M747318</guid>
      <dc:creator>Dewa Negara_4</dc:creator>
      <dc:date>2004-09-09T03:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: SFTP using expect script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sftp-using-expect-script/m-p/3375366#M747319</link>
      <description>&lt;BR /&gt;Make the script only readable and executable by root (chmod 500 scriptname) or write a C program that creates the script on the fly and then executes it, or write the program in perl and then compile (perlcc) it. You will have to make sure you don't put the passwd in a contiguous string.&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Thu, 09 Sep 2004 06:19:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sftp-using-expect-script/m-p/3375366#M747319</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2004-09-09T06:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: SFTP using expect script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sftp-using-expect-script/m-p/3375367#M747320</link>
      <description>That's the downside of sftp with expect - you need to hard code it.&lt;BR /&gt;&lt;BR /&gt;Now, what you can do, is setup certificates between the sites.&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 09 Sep 2004 07:32:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sftp-using-expect-script/m-p/3375367#M747320</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2004-09-09T07:32:36Z</dc:date>
    </item>
    <item>
      <title>Re: SFTP using expect script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sftp-using-expect-script/m-p/3375368#M747321</link>
      <description>Hi Geoff / Harry, &lt;BR /&gt;&lt;BR /&gt;Thanks. &lt;BR /&gt;&lt;BR /&gt;Will the crtificate be able to avoid hard-coded passord?&lt;BR /&gt;&lt;BR /&gt;What is the steps do configure the certificate? Sorry because this is really new for me. &lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;Negara</description>
      <pubDate>Thu, 09 Sep 2004 21:51:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sftp-using-expect-script/m-p/3375368#M747321</guid>
      <dc:creator>Dewa Negara_4</dc:creator>
      <dc:date>2004-09-09T21:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: SFTP using expect script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sftp-using-expect-script/m-p/3375369#M747322</link>
      <description>Hi Negara,&lt;BR /&gt;&lt;BR /&gt;I believe Geoff meant public/private key authentication. All your problems will be simply vanished if you follow that procedures. Check one of your old threads and you will find the procedures posted by myself and others.&lt;BR /&gt;&lt;BR /&gt;Also, look at the other thread where you mentioned about sftp working with .shosts/.rhosts. I asked you to override PreferredAuthentications options using the command line. I believe you are almost there.&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Thu, 09 Sep 2004 22:07:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sftp-using-expect-script/m-p/3375369#M747322</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-09-09T22:07:03Z</dc:date>
    </item>
    <item>
      <title>Re: SFTP using expect script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sftp-using-expect-script/m-p/3375370#M747323</link>
      <description>Hi Sridhar, &lt;BR /&gt;&lt;BR /&gt;Thanks. I got a new problem now. The remote server belongs to other company. So we not eligible to suggest them to modify their sshd_config. I have talked to my boss and he agreed to use expect script. But it will be better if the hard-coded password can be prevented. So I am trying to find how can we avoid the hard-coded password in the script. &lt;BR /&gt;&lt;BR /&gt;Thanks for your help Sridhar. &lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Negara</description>
      <pubDate>Thu, 09 Sep 2004 22:57:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sftp-using-expect-script/m-p/3375370#M747323</guid>
      <dc:creator>Dewa Negara_4</dc:creator>
      <dc:date>2004-09-09T22:57:13Z</dc:date>
    </item>
    <item>
      <title>Re: SFTP using expect script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sftp-using-expect-script/m-p/3375371#M747324</link>
      <description>Hi Negara,&lt;BR /&gt;&lt;BR /&gt;You don't really have much choice other than what Harry already gave you if you are planning to use expect.&lt;BR /&gt;&lt;BR /&gt;If you have to run it some user, then make sure the permissions are set to only 500 for the script so that others can't read the script.&lt;BR /&gt;&lt;BR /&gt;If you have to share the password, then create a user say user and a group 'secgrp' with all the users that need to run the script in it. Then put it in a secured directory owned by 'secuser' but to be only read by 'secgrp'. In side that directory change the permissions to '4510' with 'secuser:secgrp' as the ownership. This way only secuser will be able to view the file. Members in secgrp will only be able to execute it as secuser but not read it. &lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Thu, 09 Sep 2004 23:34:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sftp-using-expect-script/m-p/3375371#M747324</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-09-09T23:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: SFTP using expect script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sftp-using-expect-script/m-p/3375372#M747325</link>
      <description>Hi Sridhar, &lt;BR /&gt;&lt;BR /&gt;Thanks alot. &lt;BR /&gt;&lt;BR /&gt;Then I need to think alternatively using perl or C as suggested by Harry. At least I can make it more secure by compiling the script.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;Negara</description>
      <pubDate>Fri, 10 Sep 2004 02:04:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sftp-using-expect-script/m-p/3375372#M747325</guid>
      <dc:creator>Dewa Negara_4</dc:creator>
      <dc:date>2004-09-10T02:04:58Z</dc:date>
    </item>
    <item>
      <title>Re: SFTP using expect script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sftp-using-expect-script/m-p/3375373#M747326</link>
      <description>You can encrypt your whole expect script with ccrypt utility. This is an enhanced version of standard unix crypt utility. It can encrypt and decrypt a file.&lt;BR /&gt;&lt;BR /&gt;For more details on ccrypt&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://sourceforge.net/projects/ccrypt/" target="_blank"&gt;http://sourceforge.net/projects/ccrypt/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;A pre compiled version for hp-ux is available&lt;BR /&gt;from following location&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://quasar.mathstat.uottawa.ca/~selinger/ccrypt/" target="_blank"&gt;http://quasar.mathstat.uottawa.ca/~selinger/ccrypt/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;After downloading, Just gunzip and untar the package. After setting proper permission (if required), encrypt your expect file.&lt;BR /&gt;&lt;BR /&gt;for example&lt;BR /&gt;&lt;BR /&gt;# ./ccrypt -e &lt;FILE_TO_ENCRYPT&gt;&lt;BR /&gt;Enter encryption key: &amp;lt; set your passphrase&amp;gt;&lt;BR /&gt;Enter encryption key: (repeat)&lt;BR /&gt;&lt;BR /&gt;The encrypted file will be stored as "File_to_encrypt.cpt"&lt;BR /&gt;&lt;BR /&gt;To decrypt&lt;BR /&gt;&lt;BR /&gt;./ccrypt -d &lt;FILE name=""&gt;&lt;BR /&gt;&lt;BR /&gt;The file will be retained to original format after you enter the passphrase.&lt;BR /&gt;&lt;BR /&gt;For more ccrypt advanced  options refer README&lt;BR /&gt;&lt;BR /&gt;So, whenever you need to use sftp just decrypt your expect file on other time keep it as encrypted.&lt;BR /&gt;&lt;BR /&gt;Hope this helps&lt;BR /&gt;&lt;BR /&gt;&lt;/FILE&gt;&lt;/FILE_TO_ENCRYPT&gt;</description>
      <pubDate>Fri, 10 Sep 2004 04:28:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sftp-using-expect-script/m-p/3375373#M747326</guid>
      <dc:creator>Michael Selvesteen_2</dc:creator>
      <dc:date>2004-09-10T04:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: SFTP using expect script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sftp-using-expect-script/m-p/3375374#M747327</link>
      <description>Hi Michael, &lt;BR /&gt;&lt;BR /&gt;Thanks alot. &lt;BR /&gt;&lt;BR /&gt;I have installed the software and it looks fine for me. &lt;BR /&gt;&lt;BR /&gt;One more problem how can we make encryption/decryption of the script using batch file? Any idea?&lt;BR /&gt;&lt;BR /&gt;Thanks and Best Regards,&lt;BR /&gt;Negara</description>
      <pubDate>Wed, 15 Sep 2004 23:15:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sftp-using-expect-script/m-p/3375374#M747327</guid>
      <dc:creator>Dewa Negara_4</dc:creator>
      <dc:date>2004-09-15T23:15:39Z</dc:date>
    </item>
  </channel>
</rss>

