Author Topic: 421 Service not available, remote server has closed connection  (Read 18284 times)

Offline rupert.sciamenna

  • New user
  • *
  • Posts: 4
    • View Profile
421 Service not available, remote server has closed connection
« on: December 30, 2008, 12:50:29 pm »
Hi to all.

Excuse me for the english, but I'm italian and I don't speak english very well.

I have a probe to connect to the ProFTPD server from the browser and from terminal.

When I digit from the terminal ftp xx.xx.xx.xx, it returns the next answer:

Connected to xx.xx.xx.xx (xx.xx.xx.xx).
421 Service not available, remote server has closed connection

The configuration file that I've specified is the next:

Code: [Select]
ServerName "ServerName"
ServerAdmin address@domain.it
ServerType standalone
DefaultServer on
IdentLookups off
UseReverseDNS off
Port 21
Umask 022
ListOptions "-a"
AllowRetrieveRestart on
AllowStoreRestart on
MaxInstances 30
User ftp
Group ftp
UseSendfile no

LoadFile /usr/libexec/proftpd/mod_sql.so
LoadFile /usr/libexec/proftpd/mod_sql_mysql.so
LoadFile /usr/libexec/proftpd/mod_ldap.so

LoadModule mod_sql.c
LoadModule mod_sql_mysql.c

# Configurazione MySQL:
AuthOrder mod_sql.c mod_ldap.c

SQLAuthenticate on
SQLAuthTypes Plaintext
SQLConnectInfo db@localhost:3306 username password
SQLDefaultGID 1000
SQLDefaultUID 1000
SQLUserInfo utenti username passwd gid uid homedir shell
SQLUserWhereClause "LoginAllowed='Y'"
#SQLGroupInfo utenti groupname gid username
#SQLLog PASS updatelogin
#SQLNamedQuery updatelogin UPDATE "count=count+1 WHERE username='%u'" utenti

# Filtri files/cartelle:
PathAllowFilter "^[a-zA-Z0-9 _.-]()"
PathDenyFilter (\.ftp)|(\.ht)[a-z]+$
AllowFilter ""^[a-zA-Z0-9@~ /,_.-]*$""
DenyFilter "%"

DefaultRoot ~ !users

# Normally, we want users to do a few things.
<Global>
AllowOverwrite yes
<Limit ALL SITE_CHMOD>
AllowAll
</Limit>
</Global>

AllowForeignAddress on

I use Webmin to configure ProFTPD.

When I test the file, ProFTPD return me - warning: handling possibly truncated configuration data at line 54 of '/usr/local/etc/proftpd.conf'.

Can someone help me? I don't know where is the error.

Thanks a lot.

Offline castaglia

  • Administrator
  • Support Hero
  • *****
  • Posts: 5059
    • View Profile
    • http://www.castaglia.org/
Re: 421 Service not available, remote server has closed connection
« Reply #1 on: December 30, 2008, 09:23:02 pm »
You should configure an SQLLogFile:

  http://www.proftpd.org/docs/contrib/mod_sql.html#SQLLogFile

and see if it shows any errors/issues.

Offline rupert.sciamenna

  • New user
  • *
  • Posts: 4
    • View Profile
Re: 421 Service not available, remote server has closed connection
« Reply #2 on: December 31, 2008, 04:13:24 pm »
I read in the log file proftpd.log that I change the ServerType from StandAlone because the address 0.0.0.0 is binded from another server. I have changed the ServerType with inetd and edited the xinetd.d/ftp file:

Code: [Select]
# default: off
# description: The ProFTPD FTP server serves FTP connections. It uses \
# normal, unencrypted usernames and passwords for authentication.
service proftpd
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/sbin/proftpd
server_args =
groups = no
flags = REUSE IPv6
}

When I connect to the server it response with: ftp: connect: Connection refused.

I have read some examples to edit inetd, xinetd but I can't find the file inetd.conf on my server.

Offline rupert.sciamenna

  • New user
  • *
  • Posts: 4
    • View Profile
Re: 421 Service not available, remote server has closed connection
« Reply #3 on: January 02, 2009, 12:37:47 pm »
A correction.

I've searched the syslog of my server and I found these entries:

Code: [Select]
Jan  2 12:37:33 vps286 xinetd[15569]: attribute server_args expects at least 1 value and none were given. [file=/etc/xinetd.d/ftp] [line=11]
Jan  2 12:37:33 vps286 xinetd[15569]: Error parsing attribute server_args - DISABLING SERVICE [file=/etc/xinetd.d/ftp] [line=11]
Jan  2 12:37:33 vps286 xinetd[15569]: incomplete entry [file=/etc/xinetd.d/ftp] [line=16]
Jan  2 12:37:33 vps286 xinetd[15569]: missing } in last service entry [file=/etc/xinetd.d/ftp] [line=16]
Jan  2 12:37:33 vps286 xinetd[15569]: 15569 {init_services} no services. Exiting...
Jan  2 12:39:18 vps286 xinetd[9278]: attribute server_args expects at least 1 value and none were given. [file=/etc/xinetd.d/ftp] [line=11]
Jan  2 12:39:18 vps286 xinetd[9278]: Error parsing attribute server_args - DISABLING SERVICE [file=/etc/xinetd.d/ftp] [line=11]
Jan  2 12:39:18 vps286 xinetd[9278]: incomplete entry [file=/etc/xinetd.d/ftp] [line=16]
Jan  2 12:39:18 vps286 xinetd[9278]: missing } in last service entry [file=/etc/xinetd.d/ftp] [line=16]
Jan  2 12:39:18 vps286 xinetd[9278]: 9278 {init_services} no services. Exiting...
Jan  2 12:41:07 vps286 proftpd[5693]: address.com (XX.XX.XX.XX[XX.XX.XX.XX]) - FTP session closed.
Jan  2 12:42:35 vps286 proftpd[27945]: address.com (XX.XX.XX.XX[XX.XX.XX.XX]) - FTP session closed.
Jan  2 12:45:36 vps286 xinetd[7783]: attribute server_args expects at least 1 value and none were given. [file=/etc/xinetd.d/ftp] [line=11]
Jan  2 12:45:36 vps286 xinetd[7783]: Error parsing attribute server_args - DISABLING SERVICE [file=/etc/xinetd.d/ftp] [line=11]
Jan  2 12:45:36 vps286 xinetd[7783]: xinetd Version 2.3.14 started with libwrap loadavg labeled-networking options compiled in.
Jan  2 12:45:36 vps286 xinetd[7783]: Started working: 0 available services
Jan  2 12:45:42 vps286 proftpd[9991]: address.com (XX.XX.XX.XX[XX.XX.XX.XX]) - FTP session closed.

This is my /etc/xinetd.conf file:
Code: [Select]
defaults
{
instances = 60
log_type = SYSLOG authpriv
log_on_success = HOST PID
log_on_failure = HOST
cps = 25 30
}

includedir /etc/xinetd.d

This is my /etc/xinetd.d/ftp file:
Code: [Select]
# default: off
# description: The ProFTPD FTP server serves FTP connections. It uses \
# normal, unencrypted usernames and passwords for authentication.
service ftp
{
disable = no
socket_type = stream
wait = no
user = ftp
server = /usr/sbin/proftpd
server_args =
groups = no
flags = REUSE
        log_on_success += DURATION USERID
        log_on_failure += USERID
}

Can someone help me, please?

Thanks.

Offline rupert.sciamenna

  • New user
  • *
  • Posts: 4
    • View Profile
Re: 421 Service not available, remote server has closed connection
« Reply #4 on: January 05, 2009, 11:14:05 am »
Hi. I found this error in mysql.log file:

Code: [Select]
Jan 05 12:05:08 mod_sql/4.2.2[27716]: defaulting to 'mysql' backend
Jan 05 12:05:08 mod_sql/4.2.2[27716]: backend module 'mod_sql_mysql/4.0.7'
Jan 05 12:05:08 mod_sql/4.2.2[27716]: backend api    'mod_sql_api_v1'
Jan 05 12:05:08 mod_sql/4.2.2[27716]: >>> sql_sess_init
Jan 05 12:05:08 mod_sql/4.2.2[27716]: entering mysql cmd_defineconnection
Jan 05 12:05:08 mod_sql/4.2.2[27716]:   name: 'default'
Jan 05 12:05:08 mod_sql/4.2.2[27716]:   user: 'proftpd'
Jan 05 12:05:08 mod_sql/4.2.2[27716]:   host: 'localhost'
Jan 05 12:05:08 mod_sql/4.2.2[27716]:     db: 'database'
Jan 05 12:05:08 mod_sql/4.2.2[27716]:   port: '3306'
Jan 05 12:05:08 mod_sql/4.2.2[27716]:    ttl: '0'
Jan 05 12:05:08 mod_sql/4.2.2[27716]: exiting mysql cmd_defineconnection
Jan 05 12:05:08 mod_sql/4.2.2[27716]: entering mysql cmd_open
Jan 05 12:05:08 mod_sql/4.2.2[27716]: exiting mysql cmd_open
Jan 05 12:05:08 mod_sql/4.2.2[27716]: unrecoverable backend error
Jan 05 12:05:08 mod_sql/4.2.2[27716]: error: '1045'
Jan 05 12:05:08 mod_sql/4.2.2[27716]: message: 'Access denied for user 'proftpd'@'localhost' (using password: YES)'

I have configured a user with name and password for the proftpd connection in the mysql database in user.
The proftpd password is encoded with the Password() function.

The configuration file have this two rows:
Code: [Select]
SQLAuthTypes Plaintext
SQLConnectInfo database@localhost:3306 proftpd password

Can someone help me?

Thanks.

 

sighted planning