# vsftp is giving problems -- Windows style.

## dE_logics

It's just behaving unpredictable... with the same config file, at times it works at times it does not. Actually after I changed the anon_root to a path which contained '(', the problem started. here is my vsftpd.conf - 

```
anonymous_enable=YES

local_enable=YES

write_enable=YES

local_umask=007

anon_upload_enable=YES

anon_mkdir_write_enable=YES

dirmessage_enable=YES

xferlog_enable=YES

connect_from_port_20=YES

chown_uploads=YES

chown_username=de

ls_recurse_enable=YES

listen=YES

anon_root="/mnt/media_writeit!/temp(others)/FTP/"
```

Another problem is that I cant upload (using Konqueror)/make files/dirs etc... even though I've given the access both in vsftpd.conf and the local permission.

----------

## Yuu

Hi,

as I'm using vsftpd too and for you, I've tried this : I created a directory called "tmp(others)" for my "tf" user. So, I have : "/home/tf/tmp(others)/" and a sample file into it : 

```
tf@server ~ $ ls tmp\(others\)/

testfile
```

And I'm using "user_config_dir" to have a "special configuration" for each user. So, my tf's configuration is :

```
# default root

#local_root=tmp(others)/

local_root=/home/tf/tmp(others)/

hide_file=

deny_file=
```

It works with "local_root=/home/tf/tmp(others)/" and "local_root=tmp(others)/". I'm using FileZilla, and : listing, uploading and removing files is working.

Also, I have noticed that even if I restart vsftpd (/etc/init.d/vsftpd restart), changes seems to be applied only when I'm disconnecting/reconnecting to my FTP server, maybe because restarting vsftpd doesn't kill active FTP sessions.

Could you try removing the quotes (") from the anon_root option ?

PS : I'm sorry, maybe I shouldn't advised you to use vsftpd...

Edit : fixed typo

----------

## dE_logics

 *Quote:*   

> Also, I have noticed that even if I restart vsftpd (/etc/init.d/vsftpd restart), changes seems to be applied only when I'm disconnecting/reconnecting to my FTP server, maybe because restarting vsftpd doesn't kill active FTP sessions. 

 

This appears to be a baselayout bug.

Ok, so I guess the problem is with Konqueror, so I'll try filezilla instead. Any other client?

And yes, it was pretty easy, now only the upload problem's remaining.

----------

## Yuu

Hi again,

are you sure that's a baselayout bug ? That's seems weird, because vsftpd is marked as stable.

For the upload problem, that's sounds like a permission problem. Maybe your user "de", has not the required chmod to write files ?

PS : also, there's this known bug. Maybe it is linked to a baselayout bug, or something.

----------

## dE_logics

 *Yuu wrote:*   

> Hi again,
> 
> are you sure that's a baselayout bug ? That's seems weird, because vsftpd is marked as stable.
> 
> For the upload problem, that's sounds like a permission problem. Maybe your user "de", has not the required chmod to write files ?
> ...

 

Yes, I'm sure. When you /etc/init.d/vsftpd stop, all vsftpd processes should actually stop.

I've set the permission of the folder specified in anon_root to o+rwx

----------

## dE_logics

Ok, so now ftp://localhost/ doesn't open anonymously. It's asking my username and password.

I'm reporting this to the vsftpd guys.

Actually the software cant take a few characters like (, ), it cant even take --bind from mount.

----------

## dE_logics

Ok, all issues diagnosed and resolved, now I only got 1 issue, anon_other_write_enable=YES. I.e the anonymous user cant delete files and folders.

----------

## Yuu

Same for me. Here is my /etc/vsftpd/test.conf :

```
anonymous_enable=YES

local_enable=YES

write_enable=YES

local_umask=007

anon_upload_enable=YES

anon_mkdir_write_enable=YES

dirmessage_enable=YES

xferlog_enable=YES

#connect_from_port_20=YES

chown_uploads=YES

chown_username=tf

ls_recurse_enable=YES

listen=YES

anon_root=/home/tf/

listen_port=122

pasv_min_port=25000

pasv_max_port=25100
```

Here is my ncftp's log, where I'm logging in with anonymous for the login and the password :

```
ncftp> open tf

Connecting to xxx.xxx.xxx.xxx...

(vsFTPd 2.2.2)

Logging in...                                                                   

Login successful.

Logged in to mydomain.tld.                                               

ncftp / > ls                          <- here vsftpd is supposed to show all my files

ncftp / > put testfile

put testfile: server said: Could not create file. 
```

And vsftpd.log :

```
Sat Sep  4 15:30:27 2010 [pid 24929] CONNECT: Client "xxx.xxx.xxx.xxx"

Sat Sep  4 15:30:27 2010 [pid 24928] [ftp] OK LOGIN: Client "xxx.xxx.xxx.xxx", anon password "anonymous"

Sat Sep  4 15:30:30 2010 [pid 24930] [ftp] FAIL UPLOAD: Client "xxx.xxx.xxx.xxx", "/testfile", 0.00Kbyte/sec
```

Maybe we are missing something.

----------

## dE_logics

I can create files and folders though... you cant right?

```
anon_root=/home/tf/ 
```

Permissions here?

Another question

Is there a site using which we can review our own IP address? I mean, suppose I wanna check what will ftp://<my ip> results in. That's cause I'm behind a router.

----------

## Yuu

 *dE_logics wrote:*   

> I can create files and folders though... you cant right?
> 
> ```
> anon_root=/home/tf/ 
> ```
> ...

 

Yes.

My permissions : 

```
ll -hd /home/tf

drwxr----- 9 tf nogroup 4,0K  4 sept. 15:29 /home/tf
```

And ncftp output : 

```
ncftp / > mkdir test

MKD test failed; [Create directory operation failed.]

Could not mkdir test: server said: Create directory operation failed.
```

Even with chmod 0760, it fails : 

```
ll -hd /home/tf

drwxrw---- 9 tf nobody 4,0K  4 sept. 15:29 /home/t
```

And vsftpd refuses to open FTP session with chmod 0766 : 

```
Unexpected response: OOPS: vsftpd: refusing to run with writable anonymous root 

OOPS: vsftpd: refusing to run with writable anonymous root

OOPS: child died
```

But : 

```
Q) Help! I'm getting the error message "refusing to run with writable anonymous

root".

A) vsftpd is protecting against dangerous configurations. The cause of this

message is usually dodgy ownership of the ftp home directory. The home

directory should NOT be owned by the ftp user itself. Neither should it

be writable by the ftp user. A way to fix this is:

chown root ~ftp; chmod -w ~ftp
```

Source : ftp://vsftpd.beasts.org/users/cevans/untar/vsftpd-2.3.2/FAQ

So, I guess that we must have a "public/" directory in our anon_root, which we can put files in (with correct chmod)

For you IP, you can try : http://www.monip.org

----------

## dE_logics

How bout changing the permission to 777?

IMO you should not play with the anon_root directory directly, experiment with the subdirectories.

About that site... no, I just wanted to test if my FTP is actually working on the Internet, for that I needed a sort of preview site which'll open my IP as FTP and show me how it looks.

----------

## Yuu

For chmod 0777, vsftpd gives the same error as chmod 0760 : "refusing to run with writable anonymous root". So, like I said, I think root directory mustn't be writable, but subdirectories can be writable. But I was trying the anonymous FTP for you, I don't actually need an anonymous FTP server.

Oh, and for the FTP test from another IP, maybe you could ask a friend, or use a proxy/ssh tunnel/whatever with FileZilla.

I've searched for this : http://www.google.fr/search?q=online%2Bftp%2Bclient%7Cbrowser, but I don't know if they're reliable.

----------

## dE_logics

Thanks a lot.

----------

