[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 350
  • Last Modified:

ncftpget

I'm using an ncftpget command to retrieve a file from another server. My command looks like this
ncftpget -e stdout.out -u $USER -p $PASSWORD $SERVER $OUTGOING/$FTPFILE $FTPFILE

where
$OUTGOING is a path where this file is to be placed
$FTPFILE is a name of a file it is located in the root directory of that server

What am I doing wrong? It doesn't get transfered?
0
mlevin1220
Asked:
mlevin1220
1 Solution
 
chris_calabreseCommented:
What error message are you getting back?

Some possible issues I can think of include:
o Wrong passworw
o $OUTGOING doesn't exist or don't have write permissions there
o $FTPFILE has just the base-name (fubar vs. /fubar) and the FTP server is setting your directory to $USER's home directory by default)
o $USER doesn't have permission to read $FTPFILE on $SERVER (including that $SERVER doesn't allow $USER to access anything outside $USER's home directory)

And of course, passing the password on the command line allows anyone on the same system to view it using 'ps', while passing it via FTP allows anyone on the network to view it with a sniffer (use SSH with keys if this is not acceptable).
0
 
stefan73Commented:
> use SSH with keys
I strongly second that. Don't use FTP when you can use scp/sftp.

Cheers!

Stefan
0
 
badrulnmCommented:
Try this,

ncftpget -e stdout.out -u $USER -p $PASSWORD $SERVER $OUTGOING $FTPFILE

The name of the file in local directory ($OUTGOING) is ommited because ncftpget is expecting a directory to store the $FTPFILE.
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now