# vsftpd to localhost not working [solved]

## cwc

I have a new router and I can not even ftp to myself using my local ip 192.168.1.7 and 127.0..1

linksys 3200 . NAT is enabled.  But I'm not even going through the router.  I have a level 1 switch .

I've reset the vsftpd.conf and just set:

```

anonymous_enable=NO

local_enable=YES

write_enable=YES

```

Please throw me a bone.

Here is my tty session

```

$ ftp 192.168.1.7

Connected to 192.168.1.7 (192.168.1.7).

220 (vsFTPd 3.0.2)

Name (192.168.1.7:cwc): cwc

530 Please login with USER and PASS.

SSL not available

331 Please specify the password.

Password:

230 Login successful.

Remote system type is UNIX.

Using binary mode to transfer files.

ftp> dir

200 PORT command successful. Consider using PASV.

150 Here comes the directory listing.

421 Service not available, remote server has closed connection

ftp> BYE

?Invalid command

ftp> bye

cwc@ciclo /home $ ftp 192.168.1.7

Connected to 192.168.1.7 (192.168.1.7).

220 (vsFTPd 3.0.2)

Name (192.168.1.7:cwc): cwc

530 Please login with USER and PASS.

SSL not available

331 Please specify the password.

Password:

230 Login successful.

Remote system type is UNIX.

Using binary mode to transfer files.

ftp> dir

200 PORT command successful. Consider using PASV.

150 Here comes the directory listing.

500 OOPS: 421 Service not available, remote server has closed connection

$ ftp 127.0.0.1

Connected to 127.0.0.1 (127.0.0.1).

220 (vsFTPd 3.0.2)

Name (127.0.0.1:cwc): cwc

530 Please login with USER and PASS.

SSL not available

331 Please specify the password.

Password:

230 Login successful.

Remote system type is UNIX.

Using binary mode to transfer files.

ftp> dir

200 PORT command successful. Consider using PASV.

150 Here comes the directory listing.

500 OOPS: 421 Service not available, remote server has closed connection

```

[Moderator edit: added [code] tags to preserve output layout. -Hu]

----------

## DawgG

you probably need to set some more options.

first thing i read in my working vsftpd.conf is:

```
# Listen on IPv4. xinet users must set NO or comment out

# otherwise it must be set YES

listen=YES
```

----------

## DawgG

(sorry, had to move to a different network for an ftpd with local users, my previous post was with anon users)

here is an uncommented config that works with local users, on of them is put into a chroot (username listed in  /etc/vsftpd/users.chroot)

```
anonymous_enable=NO

local_enable=YES

write_enable=YES

local_umask=022

anon_upload_enable=NO

anon_mkdir_write_enable=NO

dirmessage_enable=YES

xferlog_enable=YES

xferlog_file=/var/log/vsftpd.log

xferlog_std_format=YES

connect_from_port_20=YES

nopriv_user=ftp

async_abor_enable=NO

ftpd_banner= .: Angel's FTP-Service :.

chroot_list_enable=YES

chroot_list_file=/etc/vsftpd/users.chroot

allow_writeable_chroot=YES

ls_recurse_enable=YES

listen=YES

listen_ipv6=NO
```

note that there are many more options, a lot of them fun to work with.

GOOD LUCK!

----------

## cwc

Thanks DawgG.

The config script worked.

How do you list the users in the 

chroot_list_file=/etc/vsftpd/users.chroot 

file.

I can oly get one user to login.

----------

## DawgG

 *Quote:*   

> How do you list the users in the 
> 
> chroot_list_file=/etc/vsftpd/users.chroot 
> 
> file. 

 

just one username per line - but if you only allow local users to login they have to exist locally and must no be listed in /etc/ftpusers. as i said - vsftpd has lots of fun options not set in the default config. you can find them in the manpage.

GOOD LUCK!

----------

