# Help to set up vsftpd.conf

## rado3105

Please could you help me to set up vsftpd.

My vsftpd.conf:

```
listen=YES

listen_port=21

background=YES

anonymous_enable=YES

local_enable=YES

anon_upload_enable=YES

anon_mkdir_write_enable=YES

virtual_use_local_privs=YES

xferlog_enable=YES

xferlog_file=/var/log/vsftpd.log

connect_from_port_20=YES

chown_username=r-c

ftpd_banner= FTP Server

secure_chroot_dir=/var/run/vsftpd pam_service_name=vsftpd

rsa_cert_file=/etc/ssl/certs/vsftpd.pem

anon_root=/dev/WD1TB

local_umask=777
```

I  connect to server using total commander like a client ftp, it writes this:

```
500 OOPS: vsftpd: not found: directory given in 'secure_chroot_dir':/var/run/vsftpd pam_service_name=vsftpd 
```

Could you help me I want to be that disk /dev/WD1TB browseable and readable for anonymous and writable, readable, browseable for root and users I create(e.g john)

                                                        and I want to make folder public in that disk /dev/WD1TB/public to be readable, writable, browseable to all users include anonymous

----------

## Raffi

It looks like you got two lines joined together when you should not have

```

secure_chroot_dir=/var/run/vsftpd pam_service_name=vsftpd 

```

should be

```

secure_chroot_dir=/var/run/vsftpd

pam_service_name=vsftpd

```

----------

## rado3105

still doesnt help, it still writes me this in total commander(ftp client)

```
500 OOPS: vsftpd: not found: directory given in 'secure_chroot_dir':/var/run/vsftpd pam_service_name=vsftpd 

OFFLINE

Retry: Wait 5 sec
```

Also when I want to stop service vsftpd it shows me:

```
* Stopping FTP server: vsftpd    No /usr/sbin/vsftpd found running; none killed.

```

----------

## Raffi

Did you restart vsftpd after making the change?

Oops. I see you tried to stop it. Try killall vsftpd.

----------

## rado3105

I used killall, then I started it and then restarted and it showed me the same like before:

```
* Stopping FTP server: vsftpd    No /usr/sbin/vsftpd found running; none killed. 
```

----------

## Raffi

OK. Here's a couple of things to try.

1) After the killall

```

 /etc/init.d/vsftpd zap

 /etc/init.d/vsftpd start

```

2) If that does not work, look at your use flags. Do you have the xinetd flag set? If so, is that how you are starting up the daemon (check /etc/xinetd.d/vsftpd). If that is enabled, that would explain why the first attempts did not work as expected. You can either continue to use xinetd, or disable that and start it the /etc/init.d/ way.

For that error to be there, you must still be running a copy that had the old config. You might also have edited the wrong config (what file did you edit). You can see what is running with

```

ps auxww | grep vsftpd

```

On my machine, that shows which config file was use.

----------

## cyrillic

 *rado3105 wrote:*   

> My vsftpd.conf:
> 
> ```
> ...
> 
> ...

 

Is this a device node or a mount point ?

----------

## rado3105

I removed that line /dev/WD1TB

and it works now.

And I changed it like this:

```
listen=YES

anonymous_enable=YES

write_enable=YES

write_enable=YES

anon_upload_enable=YES

anon_mkdir_write_enable=YES

anon_other_write_enable=YES

dirmessage_enable=YES

dirlist_enable=YES

no_anon_password=YES

file_open_mode=0777

guest_enable=YES
```

Could you help me how to mount permanently that disk /mount/WD1TB to /home/ftp to be shown in ftp connection?

or how to set up, when somebody log to that ftp server he will see that disk WD1TB - but only readable?Last edited by rado3105 on Wed May 28, 2008 4:21 pm; edited 3 times in total

----------

## JC99

Here is my vsftpd.conf file and it works, give it a try...

```
listen=YES

anonymous_enable=NO

local_enable=YES

write_enable=YES

local_umask=022

dirmessage_enable=YES

xferlog_enable=YES

connect_from_port_20=NO

ftpd_banner=Welcome to my FTP service. 
```

...if it works, then add one thing at a time to it and see where it breaks, then maybe we can help you further.

----------

## bunder

 *rado3105 wrote:*   

> I removed that line /dev/WD1TB
> 
> Could you help me how to mount permanently that disk to /var/ftp to be shown in ftp connection?

 

make a partition and filesystem on the disk (if necessary) and make a line in the /etc/fstab similar to your other partitions.  then mount.

cheers

----------

## rado3105

that disk WD1TB is mounted as: 

```
UUID=4e3fccc3-a7ff-4e3d-b1d0-c8255a2444c7  /mnt/WD1TB   ext3 defaults 0  0
```

You suppose to mount it also as:

```
mount /mnt/WD1TB /home/ftp/WD1TB
```

 to be shown in ftp connection? I want to mount all disk ???

----------

