On Nov 22, 2012 12:27 AM, "Ozzy" <ozers...@gmail.com> wrote:
>
> flashed box with 0.1RC2 and most things went well. So thank you for the effords.
>
> One thing i cant get running is ftp, getting this error on ftp. sftp works ok.
>
> tried a lot of things from web like on these pages
>
> https://wiki.archlinux.org/index.php/Very_Secure_FTP_Daemon
> https://www.digitalocean.com/community/articles/how-to-set-up-vsftpd-on-ubuntu-12-04
>
> Any ideas would be nice.
I only get this error if I enable chroot in the webgui (the Restrict Folders checkbox)
The error message is associated with the secure_chroot_dir directive, about which the vsftpd manual says:
This option should be the name of a directory which is empty. Also, the directory should not be writable by the ftp user. This directory is used as a secure chroot() jail at times vsftpd does not require filesystem access.
Default: /usr/share/empty
It seems to be incorrectly setup in Alt-F...
[Added: No, it is not Alt-F fault, it is this way by design, and has plagued many users and distributions.
As it is, if you chroot (checking the Restrict Folders checkbox in the webgui), then all users will get the error; if you don't chroot, then only the anonymous user (ftp) will get the message.
From the vsftpd official FAQ:
Q) Help! I'm getting the error message "refusing to run with writable 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 Another cause might be an attempt to use chroot_local_user without setting up the directory ownership properly.
> --
> You received this message because you are subscribed to the Google Groups "Alt-F" group.
> To post to this group, send email to al...@googlegroups.com.
> To unsubscribe from this group, send email to alt-f+un...@googlegroups.com.
> Visit this group at http://groups.google.com/group/alt-f?hl=en.
> To view this discussion on the web visit https://groups.google.com/d/msg/alt-f/-/rpWxI7JBmrwJ.
>
>
On Nov 22, 2012 7:31 PM, "Ozzy" <ozers...@gmail.com> wrote:
>
> Restrict directories checked or unchecked, still the same issue. Error is before any user/pass commands, not even even anon helps
you must be using a client (ms windows?) that is using anonymous automaticaly (the 'ftp' user).
The 'ftp' user always exists, other users have to be created.
> What is the ftp root directory here that it is looking for permissions?
/var/run/vsftpd is created automatically.
> /home does not exisit as far as i know
it does as soon as you create a user with the webgui
Anyway, there is a problem with the ftp user even when Restrict is not checked. Other users work fine. I have to check it.
If you have no users, you can use the 'root' user, same pass as the webgui.
To debug, use a command line client. E.g:
with "chroot_local_user=yes"
jcard@silver:~/tmp> ftp nas
Connected to nas.homenet.
220 (vsFTPd 2.3.5)
Name (nas:jcard):
331 Please specify the password.
Password:
500 OOPS: vsftpd: refusing to run with writable root inside chroot()
ftp: Login failed.
ftp>
ftp> bye
with "chroot_local_user=no":
jcard@silver:~/tmp> ftp nas
Connected to nas.homenet.
220 (vsFTPd 2.3.5)
Name (nas:jcard):
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
257 "/mnt/md0/Users/Joao Cardoso"
ftp> bye
221 Goodbye.
On Nov 22, 2012 7:31 PM, "Ozzy" <ozers...@gmail.com> wrote:
>
> Restrict directories checked or unchecked, still the same issue. Error is before any user/pass commands, not even even anon helpsyou must be using a client (ms windows?) that is using anonymous automaticaly (the 'ftp' user).
The 'ftp' user always exists, other users have to be created.
> What is the ftp root directory here that it is looking for permissions?
/var/run/vsftpd is created automatically.
> /home does not exisit as far as i know
it does as soon as you create a user with the webgui
Anyway, there is a problem with the ftp user even when Restrict is not checked. Other users work fine. I have to check it.
/var/run/vsftpd
/var/run/vsftpdowner of this directory is root:root and if i change it to ftp:ftp and remove group permission it works. but it wont keep after restart. settings saved.