You are not logged in.

#1 2012-05-02 18:44:11

yasar11732
Member
Registered: 2010-11-29
Posts: 127

[vsftpd] [Solved] How to set anonymous root directory?

I have set up the vsftpd as I like. I can login as either my own name, or anonymous. But in anonymous login, I end up chrooted to an empty directory. I want to change that directory to somewhere else, where I keep the files I want to share. I have read wiki page, but it doesn't mention how to do it. I have also checked man vsftpd.conf, but no luck.

Edit:
Having another look at the man vsftpd.conf, I see that there is anon_root option that does exactly what I need. I have set it to some directory in my home directory. However, I am still seeing empty directory when I login as anonymous. I guess that may be because I own the directory, and not the ftp user. However, I don't want to change ownership of the directory to ftp user, since I am actively using that directory. Any ideas?

Last edited by yasar11732 (2012-05-02 19:37:18)


Yo Dawg, I heard you likes patches, so I have created a patch for your patch, so you can patch your patches before you patch.

Offline

#2 2012-05-02 18:57:54

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [vsftpd] [Solved] How to set anonymous root directory?

Normally, the vsftpd manual should have instructions on how to define an anonymous root dir. It's been a while since I used it but I definitely recall it being an option.

Quick google:

http://www.g-loaded.eu/2008/12/02/set-u … -a-minute/

Make sure your user has at least read rights to that dir. Typically, if it's in your home dir, they do not. Set it to some dir in /var or sth and symlink that dir into your own home dir, assign the dir to you as owner, and make sure the ftp user is part of a group that can read the dir. That's the cleanest solution.

Last edited by .:B:. (2012-05-02 19:07:56)


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#3 2012-05-02 19:26:05

yasar11732
Member
Registered: 2010-11-29
Posts: 127

Re: [vsftpd] [Solved] How to set anonymous root directory?

Thanks for the link, it was very helpfull. Unfortunetely, I couldn't make it work yet. Here is my latest config file:

anonymous_enable=YES
local_enable=NO
write_enable=NO
anon_root=/srv/ftp
anon_max_rate=2048000
xferlog_enable=YES
listen=YES

And, I also did

sudo mount --bind /home/yasar/somedir /srv/ftp

I have checked the ownership of files and directories:

yasar@yasar-laptop /srv/ftp $ ls -al /srv
toplam 60
drwxr-xr-x   4 root  root   4096 Nis  2 02:41 .
drwxr-xr-x  21 root  root   4096 Nis  8 16:55 ..
drwxr-xr-x 883 yasar users 28672 May  1 20:52 ftp
drwxr-xr-x   2 root  root   4096 Nis  2 02:41 http

Files and directories under ftp are owned by yasar:users and read only for others. I have also tried binding to /srv/ftp/pub, but that didn't work too. (Edit: by that didn't work, I mean I am still seeing empty directory when I login as anon.)

Edit: (Solved) I have restarted the filezilla, and it started working. I didn't see that coming hmm

Last edited by yasar11732 (2012-05-02 19:38:02)


Yo Dawg, I heard you likes patches, so I have created a patch for your patch, so you can patch your patches before you patch.

Offline

#4 2014-12-26 12:23:15

IjonTichy85
Member
From: Trier Germany
Registered: 2014-12-13
Posts: 2

Re: [vsftpd] [Solved] How to set anonymous root directory?

haha Thanks! Restarting filezilla solved it


If you have any answers, We will be glad to provide full and detailed questions.

Offline

Board footer

Powered by FluxBB