# vsftpd showing 421 service unavailable

## MeanGuy

my ports 20 and 21 are opened on the router.

im using vsftpd

ftp> open 192.168.1.2

Connected to 192.168.1.2.

421 Service not available, remote server has closed connection

thought i get this also,

root@gentoo vsftpd # netstat -a | grep ftp

tcp 0 0 *:ftp *:* LISTEN

root@gentoo vsftpd # /etc/init.d/vsftpd start

* WARNING: "vsftpd" has already been started.

so it means that its working ... here's my config file too.

#anonymous_enable=NO

# Uncomment this to allow local users to log in.

local_enable=YES

# Uncomment this to enable any form of FTP write command.

#write_enable=YES

# Default umask for local users is 077. You may wish to change this to 022,

# if your users expect that (022 is used by most other ftpd's)

#local_umask=022

# Uncomment this to allow the anonymous FTP user to upload files. This only

# has an effect if the above global write enable is activated. Also, you will

# obviously need to create a directory writable by the FTP user.

anon_upload_enable=YES

# Uncomment this if you want the anonymous FTP user to be able to create

# new directories.

anon_mkdir_write_enable=YES

# Activate directory messages - messages given to remote users when they

# go into a certain directory.

dirmessage_enable=YES

# Make sure PORT transfer connections originate from port 20 (ftp-data).

connect_from_port_20=YES

# If you want, you can arrange for uploaded anonymous files to be owned by

# a different user. Note! Using "root" for uploaded files is not

# recommended!

#chown_uploads=YES

#chown_username=whoever

# Activate logging of uploads/downloads.

xferlog_enable=YES

# If you want, you can have your log file in standard ftpd xferlog format

#xferlog_std_format=YES

# You may override where the log file goes if you like. The default is shown

# below.

xferlog_file=/var/log/vsftpd/vsftpd.log

# You may change the default value for timing out an idle session.

idle_session_timeout=600

# You may change the default value for timing out a data connection.

data_connection_timeout=120

# It is recommended that you define on your system a unique user which the

# ftp server can use as a totally isolated and unprivileged user.

nopriv_user=nobody

background=YES

listen=YES

what else am i missing?

hmmm

and  i just got this msg.root@gentoo vsftpd # ftp 192.168.1.2

Connected to 192.168.1.2.

500 OOPS: could not bind listening IPv4 socket

ftp> quit

root@gentoo vsftpd # /etc/init.d/vsftpd start

 * WARNING:  "vsftpd" has already been started.

........

im out of idea

----------

## UberLord

Check that vsftpd is actually running as a service and that xinetd isn't running or if it is that it doesn't have any references to ftp servers.

----------

## MeanGuy

umm, how do i do that?

i stopped xinitd

but what else? 

root@gentoo vsftpd # /etc/init.d/xinetd stop

 * Stopping xinetd...

----------

## UberLord

Esnure that it actually loads correctly.

The gentoo scripts aren't as good as RH's when it comes to debugging stuff imo.

Chances are that it isn't loading correctly

```
ps ax | grep vsftpd
```

If you see only 1 line returned then it isn't running regardless of what the scripts say

----------

## MeanGuy

root@gentoo vsftpd # ps ax | grep vsftpd

17340 pts/4    S      0:00 grep vsftpd

hmmmmm

----------

## UberLord

That shows that vsftpd isn't running.

Try running it in the foreground

```
vsftpd /etc/vsftpd/vsftpd.conf
```

And see what the error is

----------

## MeanGuy

root@gentoo vsftpd # vsftpd /etc/vsftpd/vsftpd.conf

root@gentoo vsftpd # ps ax | grep vsftpd 

17724 ?        S      0:00 vsftpd /etc/vsftpd/vsftpd.conf

17726 pts/4    S      0:00 grep vsftpd

so they're both not running ;l

----------

## UberLord

No, it is now running.

Can you connect to it?

----------

## MeanGuy

yeah, it did, thanx! 

now i have to find some good manuals , in creating and managing account.

i need to give 2 users an access to upload and not delete some files.

any good ones? "googling"

----------

## UberLord

ftp://vsftpd.beasts.org/users/cevans/untar/vsftpd-1.2.1/EXAMPLE/

----------

## MeanGuy

thanx. i'll try them right away  :Smile:  "checking!"

----------

## MeanGuy

hmm.. didn't work, 

but now i've created a /home/ftp/user , i had to creat users, not virtual ones..

is there a chmod for uploading? without deleting?

so far i can connect/download/upload.

but need to fix the permission thingie.

;l

----------

## UberLord

I think you have to work with the filesystem permissions.

I'm not sure how to achieve what you want - as the user can write, by default they can delete (in file system terms). I think ProFTPd can do what you want though.

----------

## MeanGuy

thanx for the help , u were really helpful.

----------

