Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
vsftp is giving problems -- Windows style.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
dE_logics
Advocate
Advocate


Joined: 02 Jan 2009
Posts: 2253
Location: $TERM

PostPosted: Fri Sep 03, 2010 3:43 am    Post subject: vsftp is giving problems -- Windows style. Reply with quote

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 -

Code:
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.
_________________
My blog
Back to top
View user's profile Send private message
Yuu
Apprentice
Apprentice


Joined: 23 Dec 2008
Posts: 223
Location: France

PostPosted: Fri Sep 03, 2010 10:25 am    Post subject: Reply with quote

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 :
Code:
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 :
Code:
# 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
_________________
Main laptop : T8300 cpu | 200 GB hard drive | 2 GB of ram | 8600M GT | Gentoo x86_64
Server : Celeron 220 cpu | 250 GB hard drive | 2 GB of ram | SiS 662 VGA | Gentoo x86_64


Last edited by Yuu on Fri Sep 03, 2010 3:46 pm; edited 1 time in total
Back to top
View user's profile Send private message
dE_logics
Advocate
Advocate


Joined: 02 Jan 2009
Posts: 2253
Location: $TERM

PostPosted: Fri Sep 03, 2010 2:19 pm    Post subject: Reply with quote

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.
_________________
My blog
Back to top
View user's profile Send private message
Yuu
Apprentice
Apprentice


Joined: 23 Dec 2008
Posts: 223
Location: France

PostPosted: Fri Sep 03, 2010 4:03 pm    Post subject: Reply with quote

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.
_________________
Main laptop : T8300 cpu | 200 GB hard drive | 2 GB of ram | 8600M GT | Gentoo x86_64
Server : Celeron 220 cpu | 250 GB hard drive | 2 GB of ram | SiS 662 VGA | Gentoo x86_64
Back to top
View user's profile Send private message
dE_logics
Advocate
Advocate


Joined: 02 Jan 2009
Posts: 2253
Location: $TERM

PostPosted: Sat Sep 04, 2010 3:40 am    Post subject: Reply with quote

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 ?

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


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
_________________
My blog
Back to top
View user's profile Send private message
dE_logics
Advocate
Advocate


Joined: 02 Jan 2009
Posts: 2253
Location: $TERM

PostPosted: Sat Sep 04, 2010 3:48 am    Post subject: Reply with quote

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.
_________________
My blog
Back to top
View user's profile Send private message
dE_logics
Advocate
Advocate


Joined: 02 Jan 2009
Posts: 2253
Location: $TERM

PostPosted: Sat Sep 04, 2010 6:02 am    Post subject: Reply with quote

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.
_________________
My blog
Back to top
View user's profile Send private message
Yuu
Apprentice
Apprentice


Joined: 23 Dec 2008
Posts: 223
Location: France

PostPosted: Sat Sep 04, 2010 1:35 pm    Post subject: Reply with quote

Same for me. Here is my /etc/vsftpd/test.conf :
Code:
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 :
Code:
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 :
Code:
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.
_________________
Main laptop : T8300 cpu | 200 GB hard drive | 2 GB of ram | 8600M GT | Gentoo x86_64
Server : Celeron 220 cpu | 250 GB hard drive | 2 GB of ram | SiS 662 VGA | Gentoo x86_64
Back to top
View user's profile Send private message
dE_logics
Advocate
Advocate


Joined: 02 Jan 2009
Posts: 2253
Location: $TERM

PostPosted: Sun Sep 05, 2010 4:29 am    Post subject: Reply with quote

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

Code:
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.
_________________
My blog
Back to top
View user's profile Send private message
Yuu
Apprentice
Apprentice


Joined: 23 Dec 2008
Posts: 223
Location: France

PostPosted: Sun Sep 05, 2010 6:59 am    Post subject: Reply with quote

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

Code:
anon_root=/home/tf/

Yes.

My permissions :
Code:
ll -hd /home/tf
drwxr----- 9 tf nogroup 4,0K  4 sept. 15:29 /home/tf


And ncftp output :
Code:
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 :
Code:
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 :
Code:
Unexpected response: OOPS: vsftpd: refusing to run with writable anonymous root
OOPS: vsftpd: refusing to run with writable anonymous root
OOPS: child died


But :
Code:
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
_________________
Main laptop : T8300 cpu | 200 GB hard drive | 2 GB of ram | 8600M GT | Gentoo x86_64
Server : Celeron 220 cpu | 250 GB hard drive | 2 GB of ram | SiS 662 VGA | Gentoo x86_64
Back to top
View user's profile Send private message
dE_logics
Advocate
Advocate


Joined: 02 Jan 2009
Posts: 2253
Location: $TERM

PostPosted: Sun Sep 05, 2010 2:00 pm    Post subject: Reply with quote

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.
_________________
My blog
Back to top
View user's profile Send private message
Yuu
Apprentice
Apprentice


Joined: 23 Dec 2008
Posts: 223
Location: France

PostPosted: Sun Sep 05, 2010 2:21 pm    Post subject: Reply with quote

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.
_________________
Main laptop : T8300 cpu | 200 GB hard drive | 2 GB of ram | 8600M GT | Gentoo x86_64
Server : Celeron 220 cpu | 250 GB hard drive | 2 GB of ram | SiS 662 VGA | Gentoo x86_64
Back to top
View user's profile Send private message
dE_logics
Advocate
Advocate


Joined: 02 Jan 2009
Posts: 2253
Location: $TERM

PostPosted: Mon Sep 06, 2010 3:51 am    Post subject: Reply with quote

Thanks a lot.
_________________
My blog
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum