Visit Jeremy's Blog.
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-30-2006, 08:45 PM   #1
Registered: Aug 2005
Distribution: Slackware 12
Posts: 106

Rep: Reputation: 15

I created a .netrc file in following manner. and placed it in /home/<user>

machine <machine_name> login <username> password <password>

now when i run ftp command with this machine name, it does not login automatically, whereas it should.

ftp <machine_name>

asks for username and password.
Old 12-01-2006, 12:22 AM   #2
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Hmmm ... works here. Does the machine name match the
actual hostname?


Last edited by Tinkster; 12-01-2006 at 12:24 AM.
Old 12-01-2006, 02:30 AM   #3
LQ Newbie
Registered: Jan 2006
Location: UK
Distribution: Slackware
Posts: 7

Rep: Reputation: Disabled
Most FTP clients require that .netrc should be readable only by the owner. So try:

chmod 600 .netrc
Old 12-01-2006, 04:38 AM   #4
Registered: Aug 2005
Distribution: Slackware 12
Posts: 106

Original Poster
Rep: Reputation: 15
great, it works now, the mode was the problem.
Old 12-01-2006, 10:40 PM   #5
Registered: Apr 2005
Location: Sweden
Distribution: Debian
Posts: 142

Rep: Reputation: 15
I know that this is not what you asked about, but.

If possible, do not use FTP, use SCP (file copy with SHH-protocol). FTP transfers your login and password in clear text, for anyone to read that can with etherial or other tools. SCP (and SSH) crypt all your trafic, inluding user name and passwords.
And never store passwords in text files...

Old 12-04-2006, 06:02 PM   #6
LQ Newbie
Registered: Nov 2006
Location: Sydney, AU
Distribution: OSX 10.5.6 and Slackware 12.2
Posts: 9

Rep: Reputation: 0
it's easy to setup password less logins for ssh based file transfer (scp/sftp).
Create the keys: ssh-keygen -t rsa
Copy key to destination: scp .ssh/ user@othermachine:
ssh to remote machine and add pub key to keys file: cat .ssh/authorized_keys
for further info, google up 'ssh keys'

And if you transfer large files and find the encryption slows you down, just turn it off with the following switch: -o Cipher=none


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
trouble logging in to ftp with .netrc laclac01 Linux - General 1 10-27-2005 01:15 PM
Passive/Active mode in Konqueror & .netrc perl21 SUSE / openSUSE 0 03-18-2005 08:11 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 01:10 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration