Discuss (FTP) and (SFTP, FTPS and SCP), our Java file transfer clients.

Connection through FTP

no avatar
User

parimal.nanoti

Posts

2

Joined

Wed Jul 30, 2008 11:10 pm

Connection through FTP

by parimal.nanoti » Wed Jul 30, 2008 11:43 pm

no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

Re: Connection through FTP

by support2 » Thu Jul 31, 2008 9:37 am

no avatar
User

parimal.nanoti

Posts

2

Joined

Wed Jul 30, 2008 11:10 pm

by parimal.nanoti » Thu Jul 31, 2008 3:35 pm

no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

by support2 » Thu Jul 31, 2008 9:11 pm

no avatar
User

tech1

Posts

2

Joined

Thu Dec 18, 2008 10:21 am

FileZilla logs

by tech1 » Fri Dec 19, 2008 2:45 am

Status: Using proxy proxyIP
Status: Connecting to proxyIP:21...
Status: Connection established, waiting for welcome message...
Response: 220--------------= TPN/BTINS FTP proxy service =------------
Response: 220---- --
Response: 220---- --
Response: 220---- --
Response: 220---- --
Response: 220---- AUTHORIZED USERS ONLY! --
Response: 220---- ALL TRANSFERS PERFORMED WITH THIS SERVICE ARE LOGGED --
Response: 220---- --
Response: 220---- --
Response: 220---- At the User prompt, enter your FTP site username and the site --
Response: 220---- you are connecting to, followed by your domain login ID. --
Response: 220---- --
Response: 220---- EXAMPLE: anonymous@microsoft.com AMSmithJ --
Response: 220---- --
Response: 220---- At the Password prompt, enter your FTP site password. --
Response: 220---- --
Response: 220---- At the Enter Password prompt, enter your domain password. --
Response: 220---- --
Response: 220 -----------------------------------------------------------------------
Command: USER remoteusername@remoteHost proxyUserName
Response: 331 Enter password.
Command: PASS ********
Response: 332 Enter proxy password.
Command: ACCT *********
Response: 230-Your bandwidth usage is restricted
Response: 230-User username has group access to: apache
Response: 230-This server supports FXP transfers
Response: 230 OK. Current restricted directory is /
Status: Connected
Status: Retrieving directory listing...
Command: PWD
Response: 257 "/" is your current location
Command: TYPE I
Response: 200 Command okay.
Command: PASV
Response: 227 Entering Passive Mode (00,11,255,11,251,170)
Command: LIST -a
Response: 150 File status okay; about to open data connection.
Response: 226 Transfer complete, closing data connection.
Status: Directory listing successful


I have set the settings in Filezilla for FTP proxy with custom settings as
USER %u@%h %s
PASS %p
ACCT %w

where %h is remotehost, %u is remoteUserName, %s is proxyusername, %p is remoteHostPassword, %w is proxyPassword.

And here is the code I'm using to ftp to the remoteHost:
FTPClient ftpClient = new FTPClient("remoteHostIP", 21);
ftpClient.setConnectMode(FTPConnectMode.PASV);
FTPClient.initSOCKS("1080", "proxyserverIP");
FTPClient.initSOCKSAuthentication("proxyUserName" , "proxyPassword");
ftpClient.login("remoteUserName", "remotePassword");
this code is giving me : java.net.SocketException: Reply from SOCKS server has bad version
at java.net.SocksSocketImpl.connectV4(SocksSocketImpl.java:300)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:371)
at java.net.Socket.connect(Socket.java:478)
at java.net.Socket.connect(Socket.java:428)
at java.net.Socket.<init>(Socket.java:335)
at java.net.Socket.<init>(Socket.java:150)
at com.enterprisedt.net.ftp.FTPControlSocket.<init>(FTPControlSocket.java:139)
at com.enterprisedt.net.ftp.FTPClient.<init>(FTPClient.java:150)

Can you help me resolve this? Thanks In Advance.
no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

Re: FileZilla logs

by support2 » Mon Dec 22, 2008 9:06 pm

The key is the settings you've worked out:

USER %u@%h %s
PASS %p
ACCT %w

So you need to supply these settings. With FTPClient you can do this via

login(String user, String password, String accountInfo)

e.g.

login("user@host proxyuser", "pwd", "proxypwd");
no avatar
User

tech1

Posts

2

Joined

Thu Dec 18, 2008 10:21 am

Re: FileZilla logs

by tech1 » Wed Dec 24, 2008 4:29 am

It worked great!! Thank you.
no avatar
User

jahner

Posts

2

Joined

Thu Feb 03, 2011 11:38 pm

Re: Connection through FTP

by jahner » Thu Mar 19, 2015 8:23 pm

Hi guys,

I have the same problem but Filezilla uses the following settings:

USER %s
PASS %w
USER %u@%h
PASS %p
ACCT %a

How can I resolve this using FTPClient?

Kind regards

Iggy
no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

Re: Connection through FTP

by support2 » Thu Mar 19, 2015 9:07 pm

That would be similar, but you need 2 commands, something like:

login("user", "pwd");
login("user@host", "proxypassword", "whateverthisis");

You'll have to experiment a bit and look at the log file.

Who is online

Users browsing this forum: No registered users and 26 guests

Powered by phpBB ® | phpBB3 Style by KomiDesign
cron