Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-25-2008, 03:54 PM   #1
Canis Polaris
LQ Newbie
Registered: May 2007
Posts: 15

Rep: Reputation: 0
ftp and .netrc

I thought I understood the man page, but obviously I missed something. (Gosh, how could anyone NOT understand those man pages?)

The man page for ftp mentions a .netrc file. Sounds simple enough. So I created a .netrc in my home directory. It looks something like this, with the specifics changed for obvious reasons.

machine nn.nn.nn.nn
login theuserthatneedstologin
password theuserspassword

I then try to execute the ftp command with the line:

ftp nn.nn.nn.nn

and this is what I get.

[oracle@cos-ora11g ~]$ ftp nn.nn.nn.nn
Connected to nn.nn.nn.nn.
220 Microsoft FTP Service
500 'AUTH GSSAPI': command not understood
500 'AUTH KERBEROS_V4': command not understood
KERBEROS_V4 rejected as an authentication type
Error - .netrc file not correct mode.
Remove password or correct mode.

I cannot find anything about correcting mode, and I want to connect without having to enter the password interactively.

What's up with this?



Last edited by Canis Polaris; 11-25-2008 at 04:01 PM. Reason: Specify OS
Old 11-25-2008, 04:06 PM   #2
LQ Newbie
Registered: Mar 2008
Posts: 11

Rep: Reputation: 0

Is the FTP server on Linux or Windows?

You might want to build a secured server like vsftpd which is pretty straight forward especially on RHEL. Then you set your permissions and user ACL.

I dont think i answered your question but im also not really sure what you are asking.
Old 11-25-2008, 04:15 PM   #3
Canis Polaris
LQ Newbie
Registered: May 2007
Posts: 15

Original Poster
Rep: Reputation: 0
Ya know, I think I'll never figure out these forum search tools. I searched for "ftp AND .netrc" and got everything including threads that happened to mention ftp somewhere but never said anything about .netrc. So I decided it was necessary to to post the question myself. And then it comes back and tells me about this post and what-a-ya-know, there's the answer. Why didn't the man page say anything about the owner having exclusive rights to read the .netrc file?

As the owner of the file, in the owner's home directory, execute "chmod 600 .netrc"

Thank God for forums 'cause those man pages are about worthless.


P.S. OK, now I understand the connection between
Error - .netrc file not correct mode.
chmod 600 .netrc
It's 'cause I'm a Newbie dontchya know.

Last edited by Canis Polaris; 11-25-2008 at 04:23 PM. Reason: Realized the root problem.
Old 11-25-2008, 04:34 PM   #4
LQ Guru
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
An excerpt from ftp manual page:
password string
      Supply a password.  If this token is present, the auto-login process will supply the speci‐
      fied string if the remote server requires a password as part of the login process.  Note
      that if this token is present in the .netrc file for any user other than anonymous, ftp
      will abort the auto-login process if the .netrc is readable by anyone besides the user.
Some manual pages are extensive and it is difficult to catch all the subtleties!



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
ftp in inittab -.netrc issue svar Linux - Networking 11 10-10-2007 02:15 AM
.netrc kniwor Linux - Newbie 5 12-04-2006 06:02 PM
trouble logging in to ftp with .netrc laclac01 Linux - General 1 10-27-2005 01:15 PM
Konqueror FTP passive/active problem & .netrc perl21 Linux - General 0 03-17-2005 04:43 PM
How to set anscii mode in FTP using .netrc gendreau Linux - Newbie 1 08-08-2003 12:05 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:47 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration