<?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: providing password in script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/providing-password-in-script/m-p/4315224#M683853</link>
    <description>Do you want to insert user/password into a script ? IMHO, it's a bad idea. &lt;BR /&gt;Can you please explain why you don't want to use the standard SSH free password approach ?&lt;BR /&gt;&lt;BR /&gt;Best</description>
    <pubDate>Sat, 29 Nov 2008 08:00:08 GMT</pubDate>
    <dc:creator>Victor Fridyev</dc:creator>
    <dc:date>2008-11-29T08:00:08Z</dc:date>
    <item>
      <title>providing password in script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/providing-password-in-script/m-p/4315222#M683851</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;I need to ssh and scp to multiple servers.&lt;BR /&gt;How can I do this using a script.Password should be provided in the script, so that ssh/scp should not ask passwd for each server.&lt;BR /&gt;&lt;BR /&gt;( Some way other than exchanging ssh key )&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;sen</description>
      <pubDate>Sat, 29 Nov 2008 05:28:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/providing-password-in-script/m-p/4315222#M683851</guid>
      <dc:creator>sen_ux</dc:creator>
      <dc:date>2008-11-29T05:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: providing password in script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/providing-password-in-script/m-p/4315223#M683852</link>
      <description>Ideally, the whole purpose of ssh and scp is so you don't have to enter the password.</description>
      <pubDate>Sat, 29 Nov 2008 06:07:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/providing-password-in-script/m-p/4315223#M683852</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-11-29T06:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: providing password in script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/providing-password-in-script/m-p/4315224#M683853</link>
      <description>Do you want to insert user/password into a script ? IMHO, it's a bad idea. &lt;BR /&gt;Can you please explain why you don't want to use the standard SSH free password approach ?&lt;BR /&gt;&lt;BR /&gt;Best</description>
      <pubDate>Sat, 29 Nov 2008 08:00:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/providing-password-in-script/m-p/4315224#M683853</guid>
      <dc:creator>Victor Fridyev</dc:creator>
      <dc:date>2008-11-29T08:00:08Z</dc:date>
    </item>
    <item>
      <title>Re: providing password in script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/providing-password-in-script/m-p/4315225#M683854</link>
      <description>Hi Sen:&lt;BR /&gt;&lt;BR /&gt;You can and should avoid passwords in scripts if you are automating Secure Shell functions like 'scp', 'sftp', etc.&lt;BR /&gt;&lt;BR /&gt;Setup and use public keys among your servers.&lt;BR /&gt;&lt;BR /&gt;These two links should provide you the information you need to easily do this:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://sial.org/howto/openssh/publickey-auth/" target="_blank"&gt;http://sial.org/howto/openssh/publickey-auth/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1254688&amp;amp;admit=109447626+1227965745456+28353475" target="_blank"&gt;http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1254688&amp;amp;admit=109447626+1227965745456+28353475&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The 'known_hosts' file contains the public host keys for all known hosts.  The per-user version is maintained automatically.  Thus, whenever you connect from an unknown host, its key is added to the per-user file if you choose to acknowledge the fingerprint.  If you don't, the connection can still be made, but you will be prompted the next time as if you had never connected.&lt;BR /&gt;&lt;BR /&gt;The manpages for 'sshd' and 'ssh' offer more information.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Sat, 29 Nov 2008 13:41:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/providing-password-in-script/m-p/4315225#M683854</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-11-29T13:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: providing password in script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/providing-password-in-script/m-p/4315226#M683855</link>
      <description>as noted, this is a *bad* idea.  usual practice would be the key exchange to allow passwordless login.&lt;BR /&gt;&lt;BR /&gt;As far as I know, the only workable alternative would be to use "expect" to script the connection.</description>
      <pubDate>Sat, 29 Nov 2008 15:46:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/providing-password-in-script/m-p/4315226#M683855</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2008-11-29T15:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: providing password in script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/providing-password-in-script/m-p/4315227#M683856</link>
      <description>&amp;gt; ( Some way other than exchanging ssh key )&lt;BR /&gt; &lt;BR /&gt;ssh and scp are encrypted communications protocols, commonly used to enhance security. By trying to put a password into a script, you have placed a security vulnerability into your environment, thus making ssh/scp much less secure. Setting up a public key is a commonly accepted method to run remote commands and copy files in a secure manner. Like any networking solution, the local user as well as the remote user should be evaluated as to allowed permissions. root-to-root should be evaluated. user-to-user makes more sense and for ssh commands, running sudo at the remote site is preferred over root access.</description>
      <pubDate>Sat, 29 Nov 2008 23:48:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/providing-password-in-script/m-p/4315227#M683856</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2008-11-29T23:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: providing password in script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/providing-password-in-script/m-p/4315228#M683857</link>
      <description>sen, &lt;BR /&gt;&lt;BR /&gt;JRF has the answer, &lt;BR /&gt;&lt;BR /&gt;You can use SCP or SFTP in batch mode but you need to define trusts between the two boxes in question. &lt;BR /&gt;&lt;BR /&gt;Follow the links in his posts to define the key exchange, and then within your script you can use the &lt;BR /&gt;scp -B sourceuser@&lt;SOURCESYSTEM&gt;:/path/filename.ext /destination/filename&lt;/SOURCESYSTEM&gt;</description>
      <pubDate>Mon, 26 Jan 2009 14:58:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/providing-password-in-script/m-p/4315228#M683857</guid>
      <dc:creator>rmueller58</dc:creator>
      <dc:date>2009-01-26T14:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: providing password in script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/providing-password-in-script/m-p/4315229#M683858</link>
      <description>As stated above, using passwords in a script is a bad idea.  The ssh/scp tools don't have command line options for passwords for this reason.  &lt;BR /&gt;&lt;BR /&gt;If you want to do this, you will need to use a tool like expect:&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;(Google ssh/scp expect for some sample scripts)&lt;BR /&gt;&lt;BR /&gt;You can also check out the Perl Net::SSH module:&lt;BR /&gt;&lt;A href="http://search.cpan.org/dist/Net-SSH-Perl/lib/Net/SSH/Perl.pm" target="_blank"&gt;http://search.cpan.org/dist/Net-SSH-Perl/lib/Net/SSH/Perl.pm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;There are also modules for Python and TCL that do this.   Check around on google for samples.&lt;BR /&gt;&lt;BR /&gt;key-based authentication is the way to go though.  It doesn't require any add-on tools and is secure.</description>
      <pubDate>Mon, 26 Jan 2009 15:24:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/providing-password-in-script/m-p/4315229#M683858</guid>
      <dc:creator>Autocross.US</dc:creator>
      <dc:date>2009-01-26T15:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: providing password in script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/providing-password-in-script/m-p/4315230#M683859</link>
      <description>Like the others, I would use a public key.&lt;BR /&gt;&lt;BR /&gt;To avoid problems with the private key requiring a pass-phrase, one should generate a second private/public pair without a pass-phrase, and at the remote end, you restrict that public key to doing the specific command(s) that you wish.&lt;BR /&gt;&lt;BR /&gt;In a similar vein to the others, I suggest you read, read, read (or man, man, man), but hopefully I've suggested an approach and that you'll know what to look for when reading.&lt;BR /&gt;&lt;BR /&gt;Anyone wanna suggest how to restrict a public key to scp only AND restrict it to a particular directory tree (so someone can't pick it up and mess around with the .profile, or to grab sensitive information)?&lt;BR /&gt;&lt;BR /&gt;Nick.</description>
      <pubDate>Tue, 27 Jan 2009 05:32:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/providing-password-in-script/m-p/4315230#M683859</guid>
      <dc:creator>Nick Bishop (Kiwi)</dc:creator>
      <dc:date>2009-01-27T05:32:31Z</dc:date>
    </item>
  </channel>
</rss>

