LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 08-05-2011, 11:13 PM   #1
webb.ryan
Member
 
Registered: Oct 2007
Location: Philippines / Pilipinas
Distribution: FedoraCore5 :: Debian Etch
Posts: 37

Rep: Reputation: 15
how to do FTP Active mode?


Hello!

I need to connect to a remote FTP server and that server only accepts active mode ftp. I am using a production server of Red Hat Linux (not sure of the version) and it defaults to passive connection mode. How can I connect to ftp server using active connection mode? How it should be done?

windows - defaults to active.
linux - defaults to passive.

the command i use:
ftp <ip address> 21
->then the remote ftp server asks for credentials.


please note:
Filezilla client have an option that accepts active mode. And that is possible because i noticed Filezilla uses raw ftp commands thru telnet - this is not a solution I am looking for though...the programs we have for automatic file transfers uses commercial FTP Java Library.
I dont have control on the remote ftp server and the server that the automatic ftp program is hosted on...

Your suggestion based on experience is greatly appreciated.

-Ryan
 
Old 08-06-2011, 03:00 AM   #2
Annielover
Member
 
Registered: May 2011
Location: Belgium
Distribution: Ubuntu Server Edition, Fedora 16
Posts: 90

Rep: Reputation: 8
Hi,

The primary FTP server shipped with Red Hat Enterprise Linux is vsftpd.
By default, vsftpd uses passive mode to transfer files.

In /etc/vsftpd.conf, add the following entry:
Code:
pasv_enable=NO
(The default value is "YES").

This should work.
 
Old 08-06-2011, 03:24 AM   #3
timur91
Member
 
Registered: Aug 2011
Posts: 42

Rep: Reputation: Disabled
The default active/passive mode that the connecting client will use can be enforced via the configs of the FTP server. You will need to consult the docs of your FTP server about how to do this.

java socket

Last edited by timur91; 01-05-2012 at 06:25 AM.
 
Old 08-06-2011, 03:31 AM   #4
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Hi,

If you can connect to FTP server through the auth part, then try the command 'PASV' to enable/disable Passive transfer. Active FTP vs. Passive FTP
 
Old 08-06-2011, 02:54 PM   #5
webb.ryan
Member
 
Registered: Oct 2007
Location: Philippines / Pilipinas
Distribution: FedoraCore5 :: Debian Etch
Posts: 37

Original Poster
Rep: Reputation: 15
Smile

Thank you all for your advices! All of these are noted! Based on your suggestions, The power on how the ftp client connecting (active or passive mode) to the ftp server relies on the ftp server itself..? hmm...I think I will call up the person who maintains the ftp server then to allow me to connect in ftp passive and all my problems are solved. I sure do hope that it;s okay with their policy though. I hoping they will allow it, if not I will just have to request SFTP instead.

I am thinking if there is a parameter or option i can use with the ftp command like:
ftp -a <Ip> <port> (-a for active )

so I will be able to connect in active mode.

@lithios: I issued command PASV - server replied ?invalid command. (i am connected to remote server via putty) thanks for the link too.

@annielover: Thanks for this...the server I am logging into is a red hat release. I think the remote server with FTP server is a Unix.
 
Old 08-08-2011, 10:02 AM   #6
timur91
Member
 
Registered: Aug 2011
Posts: 42

Rep: Reputation: Disabled
The command to manually swith is: passive

Unfortunately you can't pass any config parameter to the ftp command to make it switch between active and passive mode.

java socket

Last edited by timur91; 01-05-2012 at 06:25 AM.
 
  


Reply


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
FTP exception in system-config-securitylevel --- Active Mode harmandeep Red Hat 1 06-15-2011 03:17 PM
FTP in active mode may show port 21 open? cstrieder Linux - Networking 2 09-15-2010 08:17 AM
ftp - active or passive mode kshkid Programming 1 02-15-2008 10:27 PM
FTP: active and passive mode problem with some windows client tda71 Linux - Networking 2 06-14-2005 09:31 AM
Clients being linux can't use Active mode FTP paradoxlight Linux - Networking 1 03-10-2003 08:41 AM


All times are GMT -5. The time now is 11:20 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration