Hi,
I have been using this ftpserver and developed ftplet and deployed. I am bit
new to ftp development and to this ftpserver, so facing few problems while
development.
Following are the issues:
1) I am not able to configure customized command. I will attach the
configuration file and code for that.
2) I have override the beforeCommand() method in ftplet and get some list
and displayed the list but after that I am getting the following message
"425 Can't open data connection."
This means it tried to execute the actual ls (NLST) command and tried to open
the connection and probably giving this message. So, my problem is how to
suppress this message as I have already get the list and displayed using
beforeCommand() method. Alternatively, is there a way that I can pass the
string to be displayed and then it can actually happen as it is and won't get
this message. This rises to write the customized command and not able to
configure it.
3) How can we use the SSL settings and test if it is working?
4) How can we test secure FTP (sftp/ftps)?
5) How to configure LDAP user authentication apart from file-user,
db-user?
I have attached all the required files for your reference.
Any reply at the earliest will be great. Thanks a lot in advance.
Thanks and Regards,
Vinod
DISCLAIMER:
-----------------------------------------------------------------------------------------------------------------------
The contents of this e-mail and any attachment(s) are confidential and intended
for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates.
Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the
opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification,
distribution and / or publication of
this message without the prior written consent of the author of this e-mail is
strictly prohibited. If you have
received this email in error please delete it and notify the sender
immediately. Before opening any mail and
attachments please check them for viruses and defect.
-----------------------------------------------------------------------------------------------------------------------
C:\Documents and Settings\vinods>ftp 10.112.81.208
Connected to 10.112.81.208.
220 Service ready for new user.
User (10.112.81.208:(none)): anonymous
331 Guest login okay, send your complete e-mail address as password.
Password:
230 User logged in, proceed.
ftp> ls
200 Command PORT okay.
150 File status okay; about to open data connection.
README.txt
cvcLaunchdbg_1.log
testftp.txt
transfer.txt
226 Closing data connection.
ftp: 59 bytes received in 0.01Seconds 3.93Kbytes/sec.
ftp> ls LSPOLICY
200 Command PORT okay.
150 File status okay; about to open data connection.
1XCOMA8017E Policies are listed below, Choose any one:
POLICY_test 1 1 0 1
425 Can't open data connection.
ftp: 76 bytes received in 0.00Seconds 76000.00Kbytes/sec.
ftp>
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to you under the Apache License, Version
2.0 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 Unless required by
applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for
the specific language governing permissions and limitations under the
License.
-->
<server xmlns="http://mina.apache.org/ftpserver/spring/v1"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://mina.apache.org/ftpserver/spring/v1 http://mina.apache.org/ftpserver/ftpserver-1.0.xsd
"
id="myServer">
<!--
Use this section to define custom listeners, or to redefine the
default listener, aptly named "default"
-->
<listeners>
<nio-listener name="default" implicit-ssl="false" idle-timeout="6000" local-address="10.112.81.208">
<ssl>
<keystore file="gatewayftp.jks" password="gateway" key-password="gateway" />
<truststore file="gatewayftp.jks" password="gateway" />
</ssl>
<data-connection idle-timeout="6000">
<active enabled="true" local-address="10.112.81.208" ip-check="true" />
<!-- <passive ports="123" address="127.0.0.1" /> -->
</data-connection>
<!-- <blacklist>1.2.3.0/16, 1.2.4.0/16, 1.2.3.4</blacklist> -->
</nio-listener>
</listeners>
<!--
Use this section to define your Ftplets, they are configured like
regular Spring beans
-->
<!-- ftplets configurations -->
<!--
<ftplets>
<ftplet name="ftplet1">
<beans:bean class="org.apache.ftpserver.examples.MyFtplet">
<beans:property name="foo" value="123" />
</beans:bean>
</ftplet>
</ftplets>
-->
<ftplets>
<ftplet name="ftplet1">
<beans:bean class="com.ca.xcom.gateway.ftplets.GatewayFtplet">
</beans:bean>
</ftplet>
</ftplets>
<!-- The user manager, choose one -->
<file-user-manager file="./res/conf/users.properties" />
<!--
<file-user-manager file="users.properties" encrypt-passwords="true" /> -->
<!-- <db-user-manager>
<data-source>
<beans:bean class="some.datasoure.class" />
</data-source>
<insert-user>INSERT INTO FTP_USER (userid, userpassword,
homedirectory, enableflag, writepermission, idletime, uploadrate,
downloadrate) VALUES ('{userid}', '{userpassword}', '{homedirectory}',
'{enableflag}', '{writepermission}', {idletime}, {uploadrate},
{downloadrate})</insert-user>
<update-user>UPDATE FTP_USER SET
userpassword='{userpassword}',homedirectory='{homedirectory}',enableflag='{enableflag}',writepermission='{writepermission}',idletime={idletime},uploadrate={uploadrate},downloadrate={downloadrate}
WHERE userid='{userid}'</update-user>
<delete-user>DELETE FROM FTP_USER WHERE userid = '{userid}'
</delete-user>
<select-user>SELECT userid, userpassword, homedirectory,
enableflag, writepermission, idletime, uploadrate, downloadrate FROM
FTP_USER WHERE userid = '{userid}'</select-user>
<select-all-users>SELECT userid FROM FTP_USER ORDER BY userid
</select-all-users>
<is-admin>SELECT userid FROM FTP_USER WHERE userid='{userid}' AND
userid='admin'</is-admin>
<authenticate>SELECT userid from FTP_USER WHERE userid='{userid}' AND
userpassword='{userpassword}'</authenticate> -->
<!-- <select-user>SELECT USER_LOGON_ID, USER_LOGON_ID FROM
XCOM_GATEWAY_USER WHERE USER_LOGON_ID = '{userid}'</select-user>
<select-all-users>SELECT userid FROM XCOM_GATEWAY_USER ORDER BY userid
</select-all-users>
<authenticate>SELECT userid from FTP_USER WHERE userid='{userid}' AND
userpassword='{userpassword}'</authenticate>
</db-user-manager> -->
<!--
<user-manager>
<beans:bean class="org.apache.ftpserver.usermanager.LdapUserManager" />
</user-manager>
<user-manager>
<beans:bean class="com.ca.xcom.gateway.ftplets.LDAPAuthUserManager" />
</user-manager>
-->
<!-- LDAP based user manager
<user-manager>
<class>org.apache.ftpserver.usermanager.LdapUserManager</class>
<admin>admin</admin>
<ldap-url>ldap://usprlnx2:389</ldap-url>
<ldap-admin-dn>cn=%user,dc=xcomldap,dc=com</ldap-admin-dn>
<ldap-admin-password>secret</ldap-admin-password>
<ldap-authentication>simple</ldap-authentication>
<ldap-user-base-dn>dc=xcomldap,dc=com</ldap-user-base-dn>
</user-manager>
-->
<!-- The file system -->
<!-- <native-filesystem case-insensitive="false"
create-home="true" /> -->
<!-- Use this section to define custom commands.
Custom commands can also override already existing commands -->
<commands use-default="true">
<command name="LSP">
<beans:bean class="com.ca.xcom.gateway.ftplets.LSPOLICY" >
<!-- <lookup-method>execute</lookup-method> -->
</beans:bean>
</command>
</commands>
<!-- <commands use-default="false">
<command name="MYHELP">
<beans:bean class="org.apache.ftpserver.examples.MYHELP" />
</command>
</commands> -->
<!-- Define the available languages -->
<!-- <messages languages="se, no ,da" /> -->
</server>