|
Guides All Guides and HOWTO's. |
|
Thread Tools | Display Modes |
|
|||
Uploading a file using ftp and/or a .netrc file from the command line
My first recommendation
Forget about all this ftp(1) thing. Only use this if there really is no other alternative. ftp(1) is a very unsafe protocol. The password as well as the data gets sent unencrypted in plain text.Just like telnet(1) it should be retired. Use one of the safer encrypted alternatives like scp(1) or sftp(1) If you are forced to use ftp(1), first test on your local FreeBSD box. That means less trial and error transmissions of the password over the internet.
Using a .netrc to automate the ftp upload This file is documented in at the end of ftp(1). Code:
Code:
password string Supply a password. If this token is present, the auto-login process will supply the specified 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. Code:
machine localhost login adriaan password PasswordSentInPlainText macdef init prompt off preserve on put TESTFILE /home/adriaan/DESTINATION/TESTFILE ls DESTINATION quit As explained in ftp(1), it tries to locate the .netrc, in the directory named in the HOME environment variable Code:
The .netrc file contains login and initialization information used by the auto-login process. It resides in the user's home directory, unless overridden with the -N netrc option, or specified in the NETRC environ- ment variable. Code:
Forget about all this ftp(1) thing. Only use this if there really is no other alternative. ftp(1) is a very unsafe protocol. The password as well as the data gets sent unencrypted in plain text.Just like telnet(1) it should be retired. Use one of the safer encrypted alternatives like scp(1) or sftp(1)
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump Last edited by J65nko; 15th February 2013 at 12:24 AM. |
|
|||
I tried, failed to get ssh(scp)(dropbear)etc working (firewall... permissions... some misstep...)
clear thru to where I wanted it to be capable of; settled on a quicker (in the short term) pure-ftpd interim solution (for the lan anyway.) Someday someone may write a flowchart (initial install >> scp entirely setup included) making it easier for those who are short of time...
__________________
FreeBSD 13-STABLE |
|
|||
I am not sure if I really understand the problem you describe. If an user has an account and thus a password, he should be able to login using ssh.
If he or she can use ssh, it should be no problem to use scp or sftpd
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
|
|||
Correct[1] It is just that the
Quote:
Quote:
So it was more of a comment than a problem. Sorry to be not more clear initially.
__________________
FreeBSD 13-STABLE |
Tags |
.netrc, .netrc macdef, .netrc macro, ftp |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to append text to second line of a file | guitarscn | Programming | 16 | 9th November 2010 02:06 AM |
Automating FreeBSD release downloads with a .netrc file | J65nko | Guides | 4 | 11th February 2010 09:02 PM |
Automating OpenBSD snapshot downloads with a .netrc file | J65nko | Guides | 1 | 7th January 2010 03:09 AM |
Running a command with input from a file. | bigb89 | Programming | 4 | 21st January 2009 06:36 PM |
how to enable file/command completion for ksh93? | TerryP | General software and network | 1 | 31st August 2008 08:23 AM |