- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: .netrc file not been used
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-15-2007 10:18 PM
тАО10-15-2007 10:18 PM
.netrc file not been used
I've created a .netrc file which lives in the home directory and when I issue an ftp -iv
e.g
Details of .netrc
machine 172.19.1.210 login wmsftp password notshown macdef init
cd goc
lcd /opus/test/interface/out/goc/send
mput *.DTS
close
quit
Output from a debug log taken within the cobol program
Thu Oct 11 11:48:06 BST 2007
Connected to 172.19.1.210.
220 ALPHA1.xxxxxxx.co.uk FTP Server (Version 5.4) Ready.
Name (172.19.1.210:testsys): 331 Username testsys requires a Password
530 Login incorrect.
Remote system type is VMS.
425 Session is disconnected.
The cobol program is being run by the user ID testsys.
As a matter of interest, the same procedure does work at a second site which is sending to an iSeries.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-15-2007 10:48 PM
тАО10-15-2007 10:48 PM
Re: .netrc file not been used
Is the owner of the program the same user in which home_dir the file .netrc is created?
Fat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-15-2007 10:51 PM
тАО10-15-2007 10:51 PM
Re: .netrc file not been used
and .netrc permission must be 600
Fat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-15-2007 11:06 PM
тАО10-15-2007 11:06 PM
Re: .netrc file not been used
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.
e.g
/home/testsys>> ftp -iv 172.19.1.210
Connected to 172.19.1.210.
220 ALPHA1.xxxxxxx.co.uk FTP Server (Version 5.4) Ready.
331 Username wmsftp requires a Password
230 User logged in.
cd goc
250-CWD command successful.
250 New default directory is DISK$IANTEST1:[PITH.OPUS.DATA.GOC]
lcd /opus/test/interface/out/goc/send
Local directory now /opus/test/interface/out/goc/send
mput *.DTS
local: 0439369.DTS remote: 0439369.DTS
200 PORT command successful.
150 Opening data connection for DISK$IANTEST1:[PITH.OPUS.DATA.GOC]0439369.DTS; (
172.19.1.233,53401)
226 Transfer complete.
994 bytes sent in 0.00 seconds (3042.96 Kbytes/s)
local: 0439370.DTS remote: 0439370.DTS
200 PORT command successful.
150 Opening data connection for DISK$IANTEST1:[PITH.OPUS.DATA.GOC]0439370.DTS; (
172.19.1.233,53402)
226 Transfer complete.
994 bytes sent in 0.00 seconds (205.31 Kbytes/s)
close
221 Goodbye.
quit
/home/testsys>>
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-15-2007 11:26 PM
тАО10-15-2007 11:26 PM
Re: .netrc file not been used
look the error display from script:
Name (172.19.1.210:testsys): 331 Username testsys requires a Password
testsys ???
but in your .netrc file the login name is wmsftp.
I suggest to debug the cobol script to know if the .netrc file is loaded during ftp session.
Fat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-16-2007 12:56 AM
тАО10-16-2007 12:56 AM
Re: .netrc file not been used
sorry for my stupid previous suggestion.
But I think to another stupid question
Is it possible that, during cobol program execution, some environment variabile are modified or unset?
These type of errors happen generally when env vars are unset.
Fat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-16-2007 01:08 AM
тАО10-16-2007 01:08 AM
Re: .netrc file not been used
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-16-2007 02:29 AM
тАО10-16-2007 02:29 AM
Re: .netrc file not been used
Do the permissions on the cobol executable indicate its running suid (perhaps not the user you think it is)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-16-2007 02:43 AM
тАО10-16-2007 02:43 AM
Re: .netrc file not been used
Sorry but I don't agree with you.
Ftp command don't check the existens of $HOME/.netrc, but ftp use it only if $HOME/.netrc exist.
No error is displayed if the file $HOME/.netrc isn't found.
Fat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-16-2007 02:55 AM
тАО10-16-2007 02:55 AM
Re: .netrc file not been used
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.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-16-2007 03:39 AM
тАО10-16-2007 03:39 AM
Re: .netrc file not been used
if not, then I'm at a loss....I have apps that do this all the time (not cobol, but that shouldn't matter)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-16-2007 03:58 AM
тАО10-16-2007 03:58 AM
Re: .netrc file not been used
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-16-2007 11:32 PM
тАО10-16-2007 11:32 PM
Re: .netrc file not been used
In my experience this type of problem is always caused by some env. vars unset.
I don't understand if you are sure (or you debug the script) that $HOME var is set.
Could you try, if you want, to debug and verify if this var is set?
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.
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
Regards,
Fat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-17-2007 11:01 PM
тАО10-17-2007 11:01 PM
Re: .netrc file not been used
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-21-2007 07:05 PM
тАО10-21-2007 07:05 PM
Re: .netrc file not been used
Which is the result of your tests?
Are HOME, LOGNAME and other parameters defined during ftp session called by COBOL application?
Regards,
Fat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-21-2007 07:20 PM
тАО10-21-2007 07:20 PM
Re: .netrc file not been used
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.
e.g.
ftp -iv $1 <<-eof
user wmsftp notshown
cd /goc
lcd /opus/test/interface/out/goc/send
mput *.DTS
close
quit
eof
Then within the cobol program issue a call "sh /home/testsys/script $IP_address".
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-21-2007 11:00 PM
тАО10-21-2007 11:00 PM
Re: .netrc file not been used
is being used in each case?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-22-2007 01:12 AM
тАО10-22-2007 01:12 AM