APLawrence - Information and Resources for Unix and Linux Systems, Bloggers and the self-employed
RSS Feeds Get APLawrence.com by RSS











(OLDER) <- More Stuff -> (NEWER) (NEWEST)
Home > News Posts > ncftp netrc ––>Re: Anybody have current ncftp binariesfor Open Server 5?
Printer Friendly Version




News Group Posts

ncftp netrc


See also Perl Net::FTP for a far, far better way to do this sort of thing.



From: "Brian K. White" <brian@aljex.com>
References: <9s96lr$ssd$1@allnight.news.cais.net>
<mjWF7.80690$ez.10308388@news1.rdc1.nj.home.com>
<9s9hf5$16lk$1@allnight.news.cais.net> Subject: Re: Anybody have current ncftp binaries for Open Server 5? Date: Wed, 07 Nov 2001 01:51:47 GMT "Barry Wiseman" <barry@gensoftdes.com> wrote in message news:9s9hf5$16lk$1@allnight.news.cais.net... > Brian K. White <brian@aljex.com> wrote in message > news:mjWF7.80690$ez.10308388@news1.rdc1.nj.home.com... > > > > "Barry Wiseman" <barry@gensoftdes.com> wrote in message > > news:9s96lr$ssd$1@allnight.news.cais.net... > > > Open Server 5.0.5. I often need to create cron jobs to put files from > > > behind a firewall. Lately I increasingly find that target servers > require > > > passive mode, which (if I RTFM correctly) vanilla SCO ftp cannae do. > > > > > > ncftp seems a good tool for the job. However, their website has SCO > > > binaries for the server only, and the client binary in skunkware is a > > fairly > > > ancient version 2.4.3, which does not support batch operations (login > > > password always expected to come from console keyboard, regardless of > > input > > > redirection). > > > > use ~/.netrc > > Well, that's what I would have hoped. But ncftp appears to disregard > ~/.netrc. Typescript below shows successful use of ~/.netrc with SCO ftp, > which then fails with ncftp; note the attempted login with current username > (duck) rather than nctest login indicated in the .netrc file. > > Script started on Tue Nov 7 15:13:55 2001 > > tty02> grep gramps /etc/hosts > 63.217.96.170 gramps gramps.gensoftdes.com > tty02> cd $HOME > tty02> cat .netrc > machine gramps login nctest password secret > tty02> ftp gramps > > Connected to gramps. > 220- > 220 gramps FTP server (Version 2.1WU(1)) ready. > 331 Password required for nctest. > 230 User nctest logged in. > Remote system type is UNIX. > Using binary mode to transfer files. > ftp> quit > 221 Goodbye. > > tty02> /usr/local/bin/ncftp -L gramps > > NcFTP 2.4.3 (March 19, 1998), by Mike Gleason. > Tip: You can get the newest version of NcFTP from ftp.NcFTP.com, in the > /ncftp directory. NcFTP is FREEware! > > Trying to connect to gramps... > > Password required for duck. > Password: > Login incorrect. > > tty02> > > script done on Tue Nov 7 15:14:41 2001












I just downloaded, installed and tried it.
I confirm your results when trying to use ncftp as root.
ncftp appears to ignore .netrc and only use it's own files in a directory
~/.ncftp
for me, it didn't create these files as root, and didn't read or write to
them if I created them manually by copying a set from a user and chmod'ing
them
it did work as a user, it created the files and saved bookmarks, and then
used the bookmarks automatically. the user is allowed to automatically login
as root to the other system by saving the root name & passwd into a bookmark

then as a user, just "ncftp bookmark-name"

so as root I was able to do the following to automatically log in as root to
another system

su - brian -c "/usr/local/bin/ncftp testhost"

where testhost is a remote system
and brian is the user that I had previously run ncftp interactively and
created a bookmark named "testhost" and put the root login in it.

I confirmed also that ncftp ignored the users valid .netrc, as well as roots



--
Brian K. White  --  brian@aljex.com  --  http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro BBx  Linux SCO  Prosper/FACTS AutoCAD  #callahans Satriani


From - Wed Nov  7 06:26:18 2001
Newsgroups: comp.unix.sco.misc
From: Jean-Pierre Radley <jpr@jpr.com>
Subject: Re: Anybody have current ncftp binaries for Open Server 5?
Date: Wed, 7 Nov 2001 02:40:27 GMT
Message-ID: <20011107024027.GW18590@jpradley.jpr.com> 
References: <9s96lr$ssd$1@allnight.news.cais.net>
<mjWF7.80690$ez.10308388@news1.rdc1.nj.home.com>
<9s9hf5$16lk$1@allnight.news.cais.net>
<Ts0G7.82030$ez.10532530@news1.rdc1.nj.home.com> Mail-Followup-To: "ScoMisc [c.u.s.m]" <scomsc@xenitec.on.ca> Brian K. White propounded (on Wed, Nov 07, 2001 at 01:51:47AM +0000): | | I just downloaded, installed and tried it. | I confirm your results when trying to use ncftp as root. | ncftp appears to ignore .netrc and only use it's own files in a directory | ~/.ncftp "Appears to?" You can't find "netrc" in the source code, except in a man page reference to a macro. | for me, it didn't create these files as root, and didn't read or write to | them if I created them manually by copying a set from a user and chmod'ing | them | it did work as a user, it created the files and saved bookmarks, and then | used the bookmarks automatically. the user is allowed to automatically login | as root to the other system by saving the root name & passwd into a bookmark | then as a user, just "ncftp bookmark-name" By design, ncftp does not create or read anything in ~/.ncftp IFF ~ == root. You can override this with NCFTPDIR=/.ncftp in root's environment. -- JP From - Wed Nov 7 06:26:18 2001 From: "Barry Wiseman" <bwiseman@sprintmail.com> Newsgroups: comp.unix.sco.misc References: <9s96lr$ssd$1@allnight.news.cais.net>
<mjWF7.80690$ez.10308388@news1.rdc1.nj.home.com>
<9s9hf5$16lk$1@allnight.news.cais.net>
<Ts0G7.82030$ez.10532530@news1.rdc1.nj.home.com> Subject: Re: Anybody have current ncftp binaries for Open Server 5? X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Message-ID: <6V2G7.20191$S4.1882834@newsread1.prod.itd.earthlink.net> Date: Wed, 07 Nov 2001 04:38:26 GMT X-Received-Date: Tue, 06 Nov 2001 20:34:28 PST (newsmaster1.prod.itd.earthlink.net) Brian K. White <brian@aljex.com> wrote in message news:Ts0G7.82030$ez.10532530@news1.rdc1.nj.home.com... > > "Barry Wiseman" <barry@gensoftdes.com> wrote in message > news:9s9hf5$16lk$1@allnight.news.cais.net... > > Brian K. White <brian@aljex.com> wrote in message > > news:mjWF7.80690$ez.10308388@news1.rdc1.nj.home.com... > > > > > > "Barry Wiseman" <barry@gensoftdes.com> wrote in message > > > news:9s96lr$ssd$1@allnight.news.cais.net... > > > > Open Server 5.0.5. I often need to create cron jobs to put files from > > > > behind a firewall. Lately I increasingly find that target servers > > require > > > > passive mode, which (if I RTFM correctly) vanilla SCO ftp cannae do. > > > > > > > > ncftp seems a good tool for the job. However, their website has SCO > > > > binaries for the server only, and the client binary in skunkware is a > > > fairly > > > > ancient version 2.4.3, which does not support batch operations (login > > > > password always expected to come from console keyboard, regardless of > > > input > > > > redirection). > > > > > > use ~/.netrc > > > > Well, that's what I would have hoped. But ncftp appears to disregard > > ~/.netrc. Typescript below shows successful use of ~/.netrc with SCO > ftp, > > which then fails with ncftp; note the attempted login with current > username > > (duck) rather than nctest login indicated in the .netrc file. > > > > Script started on Tue Nov 7 15:13:55 2001 > > > > tty02> grep gramps /etc/hosts > > 63.217.96.170 gramps gramps.gensoftdes.com > > tty02> cd $HOME > > tty02> cat .netrc > > machine gramps login nctest password secret > > tty02> ftp gramps > > > > Connected to gramps. > > 220- > > 220 gramps FTP server (Version 2.1WU(1)) ready. > > 331 Password required for nctest. > > 230 User nctest logged in. > > Remote system type is UNIX. > > Using binary mode to transfer files. > > ftp> quit > > 221 Goodbye. > > > > tty02> /usr/local/bin/ncftp -L gramps > > > > NcFTP 2.4.3 (March 19, 1998), by Mike Gleason. > > Tip: You can get the newest version of NcFTP from ftp.NcFTP.com, in the > > /ncftp directory. NcFTP is FREEware! > > > > Trying to connect to gramps... > > > > Password required for duck. > > Password: > > Login incorrect. > > > > tty02> > > > > script done on Tue Nov 7 15:14:41 2001 > > I just downloaded, installed and tried it. > I confirm your results when trying to use ncftp as root. > ncftp appears to ignore .netrc and only use it's own files in a directory > ~/.ncftp > for me, it didn't create these files as root, and didn't read or write to > them if I created them manually by copying a set from a user and chmod'ing > them > it did work as a user, it created the files and saved bookmarks, and then > used the bookmarks automatically. the user is allowed to automatically login > as root to the other system by saving the root name & passwd into a bookmark > > then as a user, just "ncftp bookmark-name" > > so as root I was able to do the following to automatically log in as root to > another system > > su - brian -c "/usr/local/bin/ncftp testhost" > > where testhost is a remote system > and brian is the user that I had previously run ncftp interactively and > created a bookmark named "testhost" and put the root login in it. > > I confirmed also that ncftp ignored the users valid .netrc, as well as roots > I have set this up on four systems tonight, two test platforms in my shop, and two production client systems. On three of the four systems, I've been unable to duplicate your result of ncftp using the password recorded in ~/.ncftp/bookmarks as opposed to prompting for it at the console. So following JP's earlier suggestion, I wrapped it in an expect script, which of course is a completely effective workaround. On the fourth system, copying once again all the materials which are now working on the first three, I find my expect script is dying in the middle. The reason? No password prompt is being issued by ncftp, instead it's logging me right in based on the bookmarks entry! So on this system, I bail on the expect approach, and run ncftp directly in my cron script with a "here" document. Cannot discover why this works on one system and fails on the other three. Oh, well. Much thanks to all for your help.

If this page was useful to you, please click to help others find it:  

Your +1's can help friends, contacts, and others on the web find the best stuff when they search.

Comments?



Click here to add your comments



Don't miss responses! Subscribe to Comments by RSS or by Email

Click here to add your comments


If you want a picture to show with your comment, go get a Gravatar



Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

Jump to Comments



Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.

Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.

We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.

g_face.jpg

This post tagged:

       - SCO_OSR5




Unix/Linux Consultants

Skills Tests

Guest Post Here