<?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: .netrc file not been used in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086700#M92208</link>
    <description>Hi John,&lt;BR /&gt;&lt;BR /&gt;sorry for my stupid previous suggestion.&lt;BR /&gt;&lt;BR /&gt;But I think to another stupid question&lt;BR /&gt;&lt;BR /&gt;Is it possible that, during cobol program execution, some environment variabile are modified or unset?&lt;BR /&gt;&lt;BR /&gt;These type of errors happen generally when env vars are unset. &lt;BR /&gt;&lt;BR /&gt;Fat&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 16 Oct 2007 07:56:19 GMT</pubDate>
    <dc:creator>Fat Scrape</dc:creator>
    <dc:date>2007-10-16T07:56:19Z</dc:date>
    <item>
      <title>.netrc file not been used</title>
      <link>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086695#M92203</link>
      <description>I've come across a problem when calling ftp from within a cobol program. &lt;BR /&gt;I've created a .netrc file which lives in the home directory and when I issue an ftp -iv &lt;IP address=""&gt; from the command line as the user which runs the cobol programme it works fine, but when the same command is called from within the program it doesn't appear to be reading the .netrc file.&lt;BR /&gt; e.g&lt;BR /&gt;&lt;BR /&gt;Details of .netrc &lt;BR /&gt;&lt;BR /&gt;machine 172.19.1.210 login wmsftp password notshown macdef init&lt;BR /&gt;cd goc&lt;BR /&gt;lcd /opus/test/interface/out/goc/send&lt;BR /&gt;mput *.DTS&lt;BR /&gt;close&lt;BR /&gt;quit &lt;BR /&gt;&lt;BR /&gt;Output from a debug log taken within the cobol program&lt;BR /&gt;&lt;BR /&gt;Thu Oct 11 11:48:06 BST 2007&lt;BR /&gt;Connected to 172.19.1.210.&lt;BR /&gt;220 ALPHA1.xxxxxxx.co.uk FTP Server (Version 5.4) Ready.&lt;BR /&gt;Name (172.19.1.210:testsys): 331 Username testsys requires a Password&lt;BR /&gt;530 Login incorrect.&lt;BR /&gt;Remote system type is VMS.&lt;BR /&gt;425 Session is disconnected.   &lt;BR /&gt;&lt;BR /&gt;The cobol program is being run by the user ID testsys.&lt;BR /&gt;&lt;BR /&gt;As a matter of interest, the same procedure does work at a second site which is sending to an iSeries.&lt;BR /&gt;&lt;/IP&gt;</description>
      <pubDate>Tue, 16 Oct 2007 05:18:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086695#M92203</guid>
      <dc:creator>John Waller</dc:creator>
      <dc:date>2007-10-16T05:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: .netrc file not been used</title>
      <link>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086696#M92204</link>
      <description>Hi John,&lt;BR /&gt;&lt;BR /&gt;Is the owner of the program the same user in which home_dir the file .netrc is created?&lt;BR /&gt;&lt;BR /&gt;Fat</description>
      <pubDate>Tue, 16 Oct 2007 05:48:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086696#M92204</guid>
      <dc:creator>Fat Scrape</dc:creator>
      <dc:date>2007-10-16T05:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: .netrc file not been used</title>
      <link>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086697#M92205</link>
      <description>Hi John,&lt;BR /&gt;&lt;BR /&gt;and .netrc permission must be 600&lt;BR /&gt;&lt;BR /&gt;Fat</description>
      <pubDate>Tue, 16 Oct 2007 05:51:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086697#M92205</guid>
      <dc:creator>Fat Scrape</dc:creator>
      <dc:date>2007-10-16T05:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: .netrc file not been used</title>
      <link>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086698#M92206</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Yes the .netrc file is in the home directory of the user testsys with permissions of 600. I don't believe I have a problem with the .netrc file itself as it works when I run the ftp from the command line. &lt;BR /&gt;&lt;BR /&gt;e.g&lt;BR /&gt;/home/testsys&amp;gt;&amp;gt; ftp -iv 172.19.1.210&lt;BR /&gt;Connected to 172.19.1.210.&lt;BR /&gt;220 ALPHA1.xxxxxxx.co.uk FTP Server (Version 5.4) Ready.&lt;BR /&gt;331 Username wmsftp requires a Password&lt;BR /&gt;230 User logged in.&lt;BR /&gt;cd goc&lt;BR /&gt;250-CWD command successful.&lt;BR /&gt;250 New default directory is DISK$IANTEST1:[PITH.OPUS.DATA.GOC]&lt;BR /&gt;lcd /opus/test/interface/out/goc/send&lt;BR /&gt;Local directory now /opus/test/interface/out/goc/send&lt;BR /&gt;mput *.DTS&lt;BR /&gt;local: 0439369.DTS remote: 0439369.DTS&lt;BR /&gt;200 PORT command successful.&lt;BR /&gt;150 Opening data connection for DISK$IANTEST1:[PITH.OPUS.DATA.GOC]0439369.DTS; (&lt;BR /&gt;172.19.1.233,53401)&lt;BR /&gt;226 Transfer complete.&lt;BR /&gt;994 bytes sent in 0.00 seconds (3042.96 Kbytes/s)&lt;BR /&gt;local: 0439370.DTS remote: 0439370.DTS&lt;BR /&gt;200 PORT command successful.&lt;BR /&gt;150 Opening data connection for DISK$IANTEST1:[PITH.OPUS.DATA.GOC]0439370.DTS; (&lt;BR /&gt;172.19.1.233,53402)&lt;BR /&gt;226 Transfer complete.&lt;BR /&gt;994 bytes sent in 0.00 seconds (205.31 Kbytes/s)&lt;BR /&gt;close&lt;BR /&gt;221 Goodbye.&lt;BR /&gt;quit&lt;BR /&gt;/home/testsys&amp;gt;&amp;gt;&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Oct 2007 06:06:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086698#M92206</guid>
      <dc:creator>John Waller</dc:creator>
      <dc:date>2007-10-16T06:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: .netrc file not been used</title>
      <link>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086699#M92207</link>
      <description>Hi John,&lt;BR /&gt;&lt;BR /&gt;look the error display from script:&lt;BR /&gt;&lt;BR /&gt;Name (172.19.1.210:testsys): 331 Username testsys requires a Password&lt;BR /&gt;&lt;BR /&gt;testsys ???&lt;BR /&gt;&lt;BR /&gt;but in your .netrc file  the login name is wmsftp.&lt;BR /&gt;&lt;BR /&gt;I suggest to debug the cobol script to know if the .netrc file is loaded during ftp session.&lt;BR /&gt;&lt;BR /&gt;Fat &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Oct 2007 06:26:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086699#M92207</guid>
      <dc:creator>Fat Scrape</dc:creator>
      <dc:date>2007-10-16T06:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: .netrc file not been used</title>
      <link>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086700#M92208</link>
      <description>Hi John,&lt;BR /&gt;&lt;BR /&gt;sorry for my stupid previous suggestion.&lt;BR /&gt;&lt;BR /&gt;But I think to another stupid question&lt;BR /&gt;&lt;BR /&gt;Is it possible that, during cobol program execution, some environment variabile are modified or unset?&lt;BR /&gt;&lt;BR /&gt;These type of errors happen generally when env vars are unset. &lt;BR /&gt;&lt;BR /&gt;Fat&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Oct 2007 07:56:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086700#M92208</guid>
      <dc:creator>Fat Scrape</dc:creator>
      <dc:date>2007-10-16T07:56:19Z</dc:date>
    </item>
    <item>
      <title>Re: .netrc file not been used</title>
      <link>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086701#M92209</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;With regards to variables being unset, that was my line of thought which is why I've posted this thread to see if anybody has come across a similar situation. To my understanding, ftp will always check for the existance of a $HOME/.netrc file. I believe the $HOME variable is OK as that is where we wrote the debug file and it's a different directory to where the cobol program which is called is located, so I presume that is OK.</description>
      <pubDate>Tue, 16 Oct 2007 08:08:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086701#M92209</guid>
      <dc:creator>John Waller</dc:creator>
      <dc:date>2007-10-16T08:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: .netrc file not been used</title>
      <link>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086702#M92210</link>
      <description>Are you running the cobol program from the command line or via cron?&lt;BR /&gt;&lt;BR /&gt;Do the permissions on the cobol executable indicate its running suid (perhaps not the user you think it is)?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Oct 2007 09:29:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086702#M92210</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2007-10-16T09:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: .netrc file not been used</title>
      <link>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086703#M92211</link>
      <description>Hi John,&lt;BR /&gt;&lt;BR /&gt;Sorry but I don't agree with you.&lt;BR /&gt;&lt;BR /&gt;Ftp command don't check the existens of $HOME/.netrc, but ftp use it only if $HOME/.netrc exist.&lt;BR /&gt;&lt;BR /&gt;No error is displayed if  the file $HOME/.netrc isn't found.&lt;BR /&gt;&lt;BR /&gt;Fat</description>
      <pubDate>Tue, 16 Oct 2007 09:43:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086703#M92211</guid>
      <dc:creator>Fat Scrape</dc:creator>
      <dc:date>2007-10-16T09:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: .netrc file not been used</title>
      <link>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086704#M92212</link>
      <description>&lt;BR /&gt;The cobol program is actually part of a full application written in cobol so it is called by another program within the application itself. Everything related to the application is being run as the user testsys, which is probably why when it fails the debug file is showing it attempting to login as testsys instead of the wmsftp user.&lt;BR /&gt;&lt;BR /&gt;Fat, I probably didn't explain myself correctly with regards to the use of a .netrc file within ftp sorry about the confusion. Though ftp doesn't check for the existance as you've pointed out it should use it if it exists and has the correct permissions i.e -r-------- . I've checked the sytem and the cobol rts doesn't have a SUID set. Again if it did I would have expected to see it attempt to login to the remote server as a different user e.g root and not testsys.</description>
      <pubDate>Tue, 16 Oct 2007 09:55:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086704#M92212</guid>
      <dc:creator>John Waller</dc:creator>
      <dc:date>2007-10-16T09:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: .netrc file not been used</title>
      <link>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086705#M92213</link>
      <description>you don't accidently have the "-n" switch in your ftp command in the cobol program perhaps?&lt;BR /&gt;&lt;BR /&gt;if not, then I'm at a loss....I have apps that do this all the time (not cobol, but that shouldn't matter)</description>
      <pubDate>Tue, 16 Oct 2007 10:39:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086705#M92213</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2007-10-16T10:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: .netrc file not been used</title>
      <link>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086706#M92214</link>
      <description>Nice try with the -n switch but no, I've checked the source code and it only runs a ftp -iv ip_address.</description>
      <pubDate>Tue, 16 Oct 2007 10:58:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086706#M92214</guid>
      <dc:creator>John Waller</dc:creator>
      <dc:date>2007-10-16T10:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: .netrc file not been used</title>
      <link>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086707#M92215</link>
      <description>Hi John,&lt;BR /&gt;&lt;BR /&gt;In my experience this type of problem is always caused by some env. vars unset.&lt;BR /&gt;&lt;BR /&gt;I don't understand if you are sure (or you debug the script) that $HOME var is set.&lt;BR /&gt;&lt;BR /&gt;Could you try, if you want, to debug and verify if this var is set?&lt;BR /&gt;&lt;BR /&gt;I created a script and I modified the path of variable $HOME, netrc file wasn't found. The same problem happens if I run the same script using switch user when "-" option is omitted, because, in this way, some variables ($HOME and other) aren't set.&lt;BR /&gt;&lt;BR /&gt;You said that the cobol program is called by a full application. Problaby when this cobol program is called some vars aren't set, caused by a anomaly/bug in the code, that you solve opening a case&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Fat</description>
      <pubDate>Wed, 17 Oct 2007 06:32:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086707#M92215</guid>
      <dc:creator>Fat Scrape</dc:creator>
      <dc:date>2007-10-17T06:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: .netrc file not been used</title>
      <link>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086708#M92216</link>
      <description>Hi,&lt;BR /&gt;Well I'm now totally confused. I've had the programmer make a change so he performs a touch on the .netrc file before trying the ftp and when the program runs it updates the time stamp on the .netrc file but still doesn't work. The next thing I'm going to ask him to try is to change the programmes so it also sets the "LOGNAME" parameter in case it is something to do with the UserID.</description>
      <pubDate>Thu, 18 Oct 2007 06:01:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086708#M92216</guid>
      <dc:creator>John Waller</dc:creator>
      <dc:date>2007-10-18T06:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: .netrc file not been used</title>
      <link>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086709#M92217</link>
      <description>Hi John,&lt;BR /&gt;&lt;BR /&gt;Which is the result of your tests?&lt;BR /&gt;Are HOME, LOGNAME and other parameters defined during ftp session called by COBOL application?&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Fat&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 22 Oct 2007 02:05:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086709#M92217</guid>
      <dc:creator>Fat Scrape</dc:creator>
      <dc:date>2007-10-22T02:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: .netrc file not been used</title>
      <link>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086710#M92218</link>
      <description>Hi&lt;BR /&gt;Yes, by displaying the variables into a debug file everything appears to be set how I would expect them to be. In the end I've wrote a script which does the ftp.&lt;BR /&gt;e.g.&lt;BR /&gt;&lt;BR /&gt;ftp -iv $1 &amp;lt;&amp;lt;-eof&lt;BR /&gt;user wmsftp notshown&lt;BR /&gt;cd /goc&lt;BR /&gt;lcd /opus/test/interface/out/goc/send&lt;BR /&gt;mput *.DTS&lt;BR /&gt;close&lt;BR /&gt;quit &lt;BR /&gt;eof&lt;BR /&gt;&lt;BR /&gt;Then within the cobol program issue a call "sh /home/testsys/script $IP_address".&lt;BR /&gt;&lt;BR /&gt;It's not ideal, but it works. I still don't understand why it doesn't work on this perticular machine but works on a number of others.&lt;BR /&gt;</description>
      <pubDate>Mon, 22 Oct 2007 02:20:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086710#M92218</guid>
      <dc:creator>John Waller</dc:creator>
      <dc:date>2007-10-22T02:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: .netrc file not been used</title>
      <link>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086711#M92219</link>
      <description>You've verified that the same "ftp" program&lt;BR /&gt;is being used in each case?</description>
      <pubDate>Mon, 22 Oct 2007 06:00:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086711#M92219</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2007-10-22T06:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: .netrc file not been used</title>
      <link>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086712#M92220</link>
      <description>Not exactly the same but we are using the standard hp-ux ftp in /usr/bin. On this machine with the problem I did notice there was an ftp program installed as part of perl so I renamed that to ensure it wasn't been picked up. The difference is that this server is PA-Risc 11.23. The working servers are either IA64 11.23 or PA-Risc 11.00,</description>
      <pubDate>Mon, 22 Oct 2007 08:12:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/netrc-file-not-been-used/m-p/4086712#M92220</guid>
      <dc:creator>John Waller</dc:creator>
      <dc:date>2007-10-22T08:12:03Z</dc:date>
    </item>
  </channel>
</rss>

