LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 11-30-2006, 08:45 PM   #1
kniwor
Member
 
Registered: Aug 2005
Distribution: Slackware 12
Posts: 106

Rep: Reputation: 15
.netrc


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
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

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

Cheers,
Tink

Last edited by Tinkster; 12-01-2006 at 12:24 AM.
 
Old 12-01-2006, 02:30 AM   #3
timufea
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
kniwor
Member
 
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
Jaxån
Member
 
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...

Yours
 
Old 12-04-2006, 06:02 PM   #6
packeteer
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/id_rsa.pub user@othermachine:
ssh to remote machine and add pub key to keys file: cat id_rsa.pub .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
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:43 PM.

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