<?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: perl script - chown within/after ftp? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-chown-within-after-ftp/m-p/4528097#M678906</link>
    <description>&lt;!--!*#--&gt;&amp;gt; [...] a HP-UX server [...]&lt;BR /&gt;&lt;BR /&gt;Not a very complete description of this&lt;BR /&gt;system.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] I need to 'chown' [...]&lt;BR /&gt;&lt;BR /&gt;Why?  Who owns the files now, and whom would&lt;BR /&gt;you like to own them?&lt;BR /&gt;&lt;BR /&gt;The FTP server on my HP-UX 11.31 system seems&lt;BR /&gt;to offer a "SITE CHMOD" command, but "chown"&lt;BR /&gt;typically requires some unusual privilege, so&lt;BR /&gt;I wouldn't expect an FTP server to offer it.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] do a 'telnet' and then 'chown'?&lt;BR /&gt;&lt;BR /&gt;And as whom were you planning to log in to do&lt;BR /&gt;that job?  (You want to put _which_ password&lt;BR /&gt;into this script?)  Even rsh/remsh can offer&lt;BR /&gt;better security than a password embedded in&lt;BR /&gt;a script.  Ssh could be safer than rsh/remsh&lt;BR /&gt;for executing a remote command, but if you&lt;BR /&gt;give some user the power to do chown, what&lt;BR /&gt;else have you made possible?&lt;BR /&gt;&lt;BR /&gt;If you care not at all about security, then&lt;BR /&gt;tasks like this get easier.</description>
    <pubDate>Thu, 05 Nov 2009 04:52:10 GMT</pubDate>
    <dc:creator>Steven Schweda</dc:creator>
    <dc:date>2009-11-05T04:52:10Z</dc:date>
    <item>
      <title>perl script - chown within/after ftp?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-chown-within-after-ftp/m-p/4528096#M678905</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have written a perl script to ftp a file from a Windows XP PC to a HP-UX server using the Net:FTP module.&lt;BR /&gt;&lt;BR /&gt;The ftp part is working fine but I need to 'chown' the file once it is ftp-ed over in the UX directory.&lt;BR /&gt;&lt;BR /&gt;How can it be done? &lt;BR /&gt;&lt;BR /&gt;This is how the script looks like :&lt;BR /&gt;&lt;BR /&gt;use Net::FTP;&lt;BR /&gt;$ftpobj = Net::FTP -&amp;gt; new ("myserver");&lt;BR /&gt;$ftpobj -&amp;gt; login("id","password");&lt;BR /&gt;$ftpobj -&amp;gt; cwd ("/home/temp");&lt;BR /&gt;$ftpobj -&amp;gt; ascii;&lt;BR /&gt;$ftpobj -&amp;gt; put (myfile);&lt;BR /&gt;$ftpobj -&amp;gt; quit;&lt;BR /&gt;&lt;BR /&gt;I don't think its possible within the ftp command - "$ftpobj -&amp;gt; chown (id, group, filename)" doesn't work.&lt;BR /&gt;&lt;BR /&gt;Do I have to separately (within the script) do a 'telnet' and then 'chown'?&lt;BR /&gt;&lt;BR /&gt;Thanks !</description>
      <pubDate>Thu, 05 Nov 2009 03:34:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-chown-within-after-ftp/m-p/4528096#M678905</guid>
      <dc:creator>so.nimda</dc:creator>
      <dc:date>2009-11-05T03:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: perl script - chown within/after ftp?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-chown-within-after-ftp/m-p/4528097#M678906</link>
      <description>&lt;!--!*#--&gt;&amp;gt; [...] a HP-UX server [...]&lt;BR /&gt;&lt;BR /&gt;Not a very complete description of this&lt;BR /&gt;system.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] I need to 'chown' [...]&lt;BR /&gt;&lt;BR /&gt;Why?  Who owns the files now, and whom would&lt;BR /&gt;you like to own them?&lt;BR /&gt;&lt;BR /&gt;The FTP server on my HP-UX 11.31 system seems&lt;BR /&gt;to offer a "SITE CHMOD" command, but "chown"&lt;BR /&gt;typically requires some unusual privilege, so&lt;BR /&gt;I wouldn't expect an FTP server to offer it.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] do a 'telnet' and then 'chown'?&lt;BR /&gt;&lt;BR /&gt;And as whom were you planning to log in to do&lt;BR /&gt;that job?  (You want to put _which_ password&lt;BR /&gt;into this script?)  Even rsh/remsh can offer&lt;BR /&gt;better security than a password embedded in&lt;BR /&gt;a script.  Ssh could be safer than rsh/remsh&lt;BR /&gt;for executing a remote command, but if you&lt;BR /&gt;give some user the power to do chown, what&lt;BR /&gt;else have you made possible?&lt;BR /&gt;&lt;BR /&gt;If you care not at all about security, then&lt;BR /&gt;tasks like this get easier.</description>
      <pubDate>Thu, 05 Nov 2009 04:52:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-chown-within-after-ftp/m-p/4528097#M678906</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2009-11-05T04:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: perl script - chown within/after ftp?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-chown-within-after-ftp/m-p/4528098#M678907</link>
      <description>Hi Steven,&lt;BR /&gt;&lt;BR /&gt;Thanks for the reply.&lt;BR /&gt;&lt;BR /&gt;It's actually a UX 11v23 test system that I'm playing with so security is not a concern for now.&lt;BR /&gt;&lt;BR /&gt;There's a series of steps that I'm trying to automate whereby I :&lt;BR /&gt;&lt;BR /&gt;1) ftp a file from my PC to the UX server using root&lt;BR /&gt;2) login as root and chown the file to a specific user&lt;BR /&gt;&lt;BR /&gt;The easiest way will be to ftp using that user but unfortunately, no one can remember the password and the file is used by an application running under that user ID - so the need for the chown.&lt;BR /&gt;&lt;BR /&gt;The chown is pretty straight forward, e.g. chown user:ugroup filename&lt;BR /&gt;&lt;BR /&gt;Nothing fancy and no need for any unusual privileges.&lt;BR /&gt;&lt;BR /&gt;Hope this clarifies.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 05 Nov 2009 07:59:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-chown-within-after-ftp/m-p/4528098#M678907</guid>
      <dc:creator>so.nimda</dc:creator>
      <dc:date>2009-11-05T07:59:46Z</dc:date>
    </item>
    <item>
      <title>Re: perl script - chown within/after ftp?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-chown-within-after-ftp/m-p/4528099#M678908</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt; Not clear why you want to run chown, however if you want to do that anyway, you can use the Net::Telnet module within your perl script so that it does the 'chown' after the file is succesfully transferred.&lt;BR /&gt;&lt;BR /&gt;use Net::Telnet;&lt;BR /&gt;$telnet = new Net::Telnet ( Timeout=&amp;gt;10, Errmode=&amp;gt;'die' Prompt =&amp;gt; '/\$ $/i'); $telnet-&amp;gt;open('host or IP'); $telnet-&amp;gt;login('username', 'passwd'); print $telnet-&amp;gt;cmd('chown usr:grp /path/to/file');&lt;BR /&gt;&lt;BR /&gt;hth&lt;BR /&gt;&lt;BR /&gt;regards,</description>
      <pubDate>Thu, 05 Nov 2009 08:09:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-chown-within-after-ftp/m-p/4528099#M678908</guid>
      <dc:creator>izad</dc:creator>
      <dc:date>2009-11-05T08:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: perl script - chown within/after ftp?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-chown-within-after-ftp/m-p/4528100#M678909</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; The easiest way will be to ftp using that user but unfortunately, no one can remember the password and the file is used by an application running under that user ID - so the need for the chown.&lt;BR /&gt;&lt;BR /&gt;Why don't you (as 'root') change the password of the target user to something you know and then do your FTP as that user?&lt;BR /&gt;&lt;BR /&gt;You could also use SFTP (I suggest Perl's 'Net::SFTP::Foreign' module) having setup public keys in lieu of hardcoding cleartext passwords.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 05 Nov 2009 13:36:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-chown-within-after-ftp/m-p/4528100#M678909</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-11-05T13:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: perl script - chown within/after ftp?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-chown-within-after-ftp/m-p/4528101#M678910</link>
      <description>&lt;!--!*#--&gt;&amp;gt; Why don't you (as 'root') change the&lt;BR /&gt;&amp;gt; password [...]?&lt;BR /&gt;&lt;BR /&gt;Especially considering:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; It's actually a UX 11v23 test system that&lt;BR /&gt;&amp;gt; I'm playing with so security is not a&lt;BR /&gt;&amp;gt; concern for now.&lt;BR /&gt;&lt;BR /&gt;Sometimes the easy way really is the easy&lt;BR /&gt;way.</description>
      <pubDate>Thu, 05 Nov 2009 14:53:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-chown-within-after-ftp/m-p/4528101#M678910</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2009-11-05T14:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: perl script - chown within/after ftp?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-chown-within-after-ftp/m-p/4528102#M678911</link>
      <description>Thanks for all your replies.&lt;BR /&gt;&lt;BR /&gt;Using root to change the password of the target user is indeed a good &lt;BR /&gt;solution but my fear is that once changed, things may not work (either due &lt;BR /&gt;to configuration, hardcoding, etc ) - that's why I'm hesitant to go that way.&lt;BR /&gt;&lt;BR /&gt;Thanks again for all the help and suggestions.&lt;BR /&gt;</description>
      <pubDate>Fri, 06 Nov 2009 00:04:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-chown-within-after-ftp/m-p/4528102#M678911</guid>
      <dc:creator>so.nimda</dc:creator>
      <dc:date>2009-11-06T00:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: perl script - chown within/after ftp?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-chown-within-after-ftp/m-p/4528103#M678912</link>
      <description>&lt;!--!*#--&gt;if the perl script runs on the HP-UX side, you could make it simply by&lt;BR /&gt;&lt;BR /&gt;system("chown user:ugroup filename");&lt;BR /&gt;with the root user&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;system("sudo chown user:ugroup filename");&lt;BR /&gt;and by grating passwordless sudo to the user executing the perl script&lt;BR /&gt;</description>
      <pubDate>Fri, 06 Nov 2009 11:39:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-chown-within-after-ftp/m-p/4528103#M678912</guid>
      <dc:creator>Viktor Balogh</dc:creator>
      <dc:date>2009-11-06T11:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: perl script - chown within/after ftp?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-chown-within-after-ftp/m-p/4528104#M678913</link>
      <description>&amp;gt;but my fear is that once changed, things may not work (either due to configuration, hardcoding, etc) - that's why I'm hesitant to go that way.&lt;BR /&gt;&lt;BR /&gt;Simply save the old passwd entry and if problems, you can always put it back.</description>
      <pubDate>Fri, 06 Nov 2009 11:48:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-chown-within-after-ftp/m-p/4528104#M678913</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-11-06T11:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: perl script - chown within/after ftp?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-chown-within-after-ftp/m-p/4528105#M678914</link>
      <description>Thanks Viktor &amp;amp; Dennis for your replies.</description>
      <pubDate>Thu, 31 Dec 2009 04:29:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-chown-within-after-ftp/m-p/4528105#M678914</guid>
      <dc:creator>so.nimda</dc:creator>
      <dc:date>2009-12-31T04:29:44Z</dc:date>
    </item>
  </channel>
</rss>

