Ftp BAckup to port different from 21

nervino

Verified User
Joined
Apr 29, 2008
Messages
7
Hi, I'm trying to send my admin backups via ftp from DA to my pc, using port 50000.
I read this thread http://www.directadmin.com/forum/showthread.php?t=23986 but I didn't get it work.

This is my /usr/local/directadmin/scripts/ftp_upload.php:
==================================
/bin/sh
FTPPUT=/usr/bin/ncftpput
if [ ! -e $FTPPUT ]; then
echo "";
echo "*** Backup not uploaded ***";
echo "Please install $FTPPUT by running:";
echo "";
echo "cd /usr/local/directadmin/scripts";
echo "./ncftp.sh";
echo "";
exit 10;
fi

CFG=${ftp_local_file}.cfg
rm -f $CFG
touch $CFG
chmod 600 $CFG
echo "host $ftp_ip" >> $CFG
echo "user $ftp_username" >> $CFG
echo "pass $ftp_password" >> $CFG

$FTPPUT -f $CFG -V -t 25 -m "$ftp_path" "$ftp_local_file" 2>&1
RET=$?

#$FTPPUT -t 25 -m -u "$ftp_username" -p "$ftp_password" "$ftp_ip" "$ftp_path" "$ftp_local_file" 2>&1

rm -f $CFG

exit $RET
===============================

I have changed the line:

#$FTPPUT -t 25 -m -u "$ftp_username" -p "$ftp_password" "$ftp_ip" "$ftp_path" "$ftp_local_file" 2>&1

to

#$FTPPUT -t 25 -m -u "$ftp_username" -p "$ftp_password" -p 50000 "$ftp_ip" "$ftp_path" "$ftp_local_file" 2>&1

but it doesn't work.

Are there any other files I have to modify?
How can I test that DA is connecting to port 50000 while uploading?

Thank you
 
Change "-p 50000" into "-P 50000" (case sensitive).

Also, copy the ftp_upload.php file into the custom folder. DirectAdmin might overwrite it with new versions.
 
Thank you getUP.
I made the change but DA is still reporting an error: ncftpput: cannot open xxx.xxx.xxx.xxx: username and/or password was not accepted for login

I also tried to test via SSH in this way:

ncftpput -u myname -p mypassword -P50000 xxx.xxx.xxx.xxx /destination_DIR /home/user/public_html/401.shtml
connect failed: Connection refused.
Falling back to PORT instead of PASV mode.
/home/user/public_html/401.shtml: 515.00 B 7.13 kB/s

The test file 401.shtml has been saved in my PC's directory.

I think DA upload is set in Passive Mode. How can I fix this?
 
I made some other tests. On my opinion, it's a firewall problem.
I have changed the firewall of my pc (MS XP) allowing "Server Ftp" for my LAN and DA sends me the backups without errors.
So I shall use the default port 21...
 
Back
Top