Busybox: Upgrade to 1.21.1 (stable). lsof active.
[tomato.git] / release / src / router / vsftpd / FAQ
blob22443e6bd66b03e6d0d76ff19d69ac395df7f72b
1 vsftpd frequently asked questions!!
2 -----------------------------------
4 Q) Can I restrict users to their home directories?
5 A) Yes. You are probably after the setting:
6 chroot_local_user=YES
8 Q) Why don't symlinks work with chroot_local_user=YES?
9 A) This is a consequence of how chroot() security works. As alternatives,
10 look into hard links, or if you have a modern Linux, see the powerful
11 "mount --bind".
13 Q) Does vsftpd support a limit on the number of users connected?
14 A1) Yes, indirectly. vsftpd is an inetd-based service. If use the popular
15 "xinetd" as your inetd, this supports per-service per-IP connection limits.
16 There is an example of this in the "EXAMPLE" directory.
17 A2) If you run vsftpd in "standalone" mode with the setting listen=YES, then
18 you can investigate the setting (e.g.):
19 max_clients=10
21 Q) Help! I'm getting the error message "refusing to run with writable anonymous
22 root".
23 A) vsftpd is protecting against dangerous configurations. The cause of this
24 message is usually dodgy ownership of the ftp home directory. The home
25 directory should NOT be owned by the ftp user itself. Neither should it
26 be writable by the ftp user. A way to fix this is:
27 chown root ~ftp; chmod -w ~ftp
29 Q) Help! I'm getting the error message "str_getpwnam".
30 A) The most likely cause of this is that the user that is configured as the
31 'nopriv_user' setting (often 'nobody') does not exist on your system. vsftpd
32 needs this user to run bits of itself with no privilege.
34 Q) Help! Local users cannot log in.
35 A) There are various possible problems.
36 A1) By default, vsftpd disables any logins other than anonymous logins. Put
37 local_enable=YES in your /etc/vsftpd.conf to allow local users to log in.
38 A2) vsftpd tries to link with PAM. (Run "ldd vsftpd" and look for libpam to
39 find out whether this has happened or not). If vsftpd links with PAM, then
40 you will need to have a PAM file installed for the vsftpd service. There is
41 a sample one for RedHat systems included in the "RedHat" directory - put it
42 under /etc/pam.d
43 A3) If vsftpd didn't link with PAM, then there are various possible issues. Is
44 the user's shell in /etc/shells? If you have shadowed passwords, does your
45 system have a "shadow.h" file in the include path?
46 A4) If you are not using PAM, then vsftpd will do its own check for a valid
47 user shell in /etc/shells. You may need to disable this if you use an invalid
48 shell to disable logins other than FTP logins. Put check_shell=NO in your
49 /etc/vsftpd.conf.
51 Q) Help! Uploads or other write commands give me "500 Unknown command.".
52 A) By default, write commands, including uploads and new directories, are
53 disabled. This is a security measure. To enable writes, put write_enable=YES
54 in your /etc/vsftpd.conf.
56 Q) Help! What are the security implications referred to in the
57 "chroot_local_user" option?
58 A) Firstly note that other ftp daemons have the same implications. It is a
59 generic problem.
60 The problem isn't too severe, but it is this: Some people have FTP user
61 accounts which are not trusted to have full shell access. If these
62 accounts can also upload files, there is a small risk. A bad user now has
63 control of the filesystem root, which is their home directory. The ftp
64 daemon might cause some config file to be read - e.g. /etc/some_file. With
65 chroot(), this file is now under the control of the user. vsftpd is
66 careful in this area. But, the system's libc might want to open locale
67 config files or other settings...
69 Q) Help! Uploaded files are appearing with permissions -rw-------.
70 A1) Depending on if this is an upload by a local user or an anonymous user,
71 use "local_umask" or "anon_umask" to change this. For example, use
72 "anon_umask=022" to give anonymously uploaded files permissions
73 -rw-r--r--. Note that the "0" before the "22" is important.
74 A2) Also see the vsftpd.conf.5 man page for the new "file_open_mode"
75 parameter.
77 Q) Help! How do I integrate with LDAP users and logins?
78 A) Use vsftpd's PAM integration to do this, and have PAM authenticate against
79 an LDAP repository.
81 Q) Help! Does vsftpd do virtual hosting setups?
82 A1) Yes. If you integrate vsftpd with xinetd, you can use xinetd to bind to
83 several different IP addresses. For each IP address, get xinetd to launch
84 vsftpd with a different config file. This way, you can get different behaviour
85 per virtual address.
86 A2) Alternatively, run as many copies as vsftpd as necessary, in standalone
87 mode. Use "listen_address=x.x.x.x" to set the virtual IP.
89 Q) Help! Does vsftpd support virtual users?
90 A) Yes, via PAM integration. Set "guest_enable=YES" in /etc/vsftpd.conf. This
91 has the effect of mapping every non-anonymous successful login to the local
92 username specified in "guest_username". Then, use PAM and (e.g.) its pam_userdb
93 module to provide authentication against an external (i.e. non-/etc/passwd)
94 repository of users.
95 Note - currently there is a restriction that with guest_enable enabled, local
96 users also get mapped to guest_username.
97 There is an example of virtual users setup in the "EXAMPLE" directory.
99 Q) Help! Does vsftpd support different settings for different users?
100 A) Yes - in a very powerful way. Look at the setting "user_config_dir" in the
101 manual page.
103 Q) Help! Can I restrict vsftpd data connections to a specific range of ports?
104 A) Yes. See the config settings "pasv_min_port" and "pasv_max_port".
106 Q) Help! I'm getting the message "OOPS: chdir".
107 A) If this is for an anonymous login, check that the home directory for the
108 user "ftp" is correct. If you are using the config setting "anon_root", check
109 that is correct too.
111 Q) Help! vsftpd is reporting times as GMT times and not local times!
112 A) This behaviour can be changed with the setting "use_localtime=YES".
114 Q) Help! Can I disable certain FTP commands?
115 A) Yes. There are some individual settings (e.g. dirlist_enable) or you can
116 specify a complete set of allowed commands with "cmds_allowed".
118 Q) Help! Can I change the port that vsftpd runs on?
119 A1) Yes. If you are running vsftpd in standalone mode, use the "listen_port"
120 directive in vsftpd.conf.
121 A2) Yes. If you are running vsftpd from an inetd or xinetd program, this
122 becomes an inetd or xinetd problem. You must change the inetd or xinetd
123 configuration files (perhaps /etc/inetd.conf or /etc/xinetd.d/vsftpd)
125 Q) Help! Will vsftpd authenticate against an LDAP server? What about a
126 MySQL server?
127 A) Yes. vsftpd uses PAM for authentication, so you need to configure PAM
128 to use pam_ldap or pam_mysql modules. This may involve installing the PAM
129 modules and then editing the PAM config file (perhaps /etc/pam.d/vsftpd).
131 Q) Help! Does vsftpd support per-IP limits?
132 A1) Yes. If you are running vsftpd standalone, there is a "max_per_ip"
133 setting.
134 A2) Yes. If you are running vsftpd via xinetd, there is an xinetd config
135 variable "per_source".
137 Q) Help! Does vsftpd support bandwidth limiting?
138 A) Yes. See vsftpd.conf.5 man page and investigate settings such as
139 "anon_max_rate" and "local_max_rate".
141 Q) Help! Does vsftpd support IP-based access control?
142 A1) Yes. vsftpd can integrate with tcp_wrappers (if built with this support).
143 It is enabled with the setting "tcp_wrappers=YES".
144 A2) Yes. vsftpd can be run from xinetd, which supports tcp_wrappers
145 integration.
147 Q) Help! Does vsftpd support IPv6?
148 A) Yes, as of version 1.2.0. Read the vsftpd.conf.5 man page.
150 Q) Help! vsftpd doesn't build, it fails with an error about being unable to
151 find -lcap.
152 A) Install the libcap package and retry the build. Seems to affect Debian
153 users a lot.
154 A) Install the libcap-devel. This certainly affects Fedora.
156 Q) Help! I've put settings in /etc/vsftpd.conf, but they are not taking
157 effect!
158 A) This is affecting some RedHat users - some RedHat versions put the config
159 file in /etc/vsftpd/vsftpd.conf.
161 Q) Help! vsftpd doesn't build, it complains about problems with incomplete
162 types in sysutil.c.
163 A) Your system probably doesn't have IPv6 support. Either use a more modern
164 system, use an older vsftpd (e.g. v1.1.3), or wait for a version of vsftpd
165 without this problem!
167 Q) Help! I'm getting messages along the lines of 500 OOPS: vsf_sysutil_bind
168 when trying to do downloads (particularly lots of small files).
169 A) vsftpd-1.2.1 should sort this out.
171 Q) Help! Does vsftpd support hiding or denying certain files?
172 A) Yes. Look at the hide_file and deny_file options in the manual page.
174 Q) Help! Does vsftpd support FXP?
175 A) Yes. An FTP server does not have to do anything special to support FXP.
176 However, you many get tripped up by vsftpd's security precautions on IP
177 addresses. In order to relax these precautions, have a look in the
178 vsftpd.conf.5 for pasv_promiscuous (and the less advisable port_promiscuous).
180 Q) Help! I'm getting the error "426 Failure writing network stream." on
181 downloads.
182 A) You shouldn't see this with v1.2.1 or newer versions of vsftpd. Older
183 versions of vsftpd can give this error if the user tries to download
184 something from an unusual filesystem (e.g. FAT), which don't support
185 performance features used by vsftpd. With vsftpd-1.1.3 and newer there is a
186 config workaround, use_sendfile=NO.
188 Q) Help! I'm using the pam_userdb login module and the login hangs.
189 A) This could be a bad interaction with glibc version 2.3 and PAM. A Debian
190 user reported this. The initial report is here:
191 http://lists.debian.org/debian-glibc/2003/debian-glibc-200309/msg00310.html
193 Q) Help! Does vsftpd support large files (>2Gb?).
194 A) Yes, it does.
196 Q) Help! Well, large file support doesn't seem to be working, then!
197 A1) Large file support first appeared in v1.1.0.
198 A2) Solaris large file support wasn't fixed until v1.2.2.
199 A3) FreeBSD large file support wasn't fixed until v1.2.2.
200 A4) The early Linux 2.6 kernels had a bug in this area - use v2.6.6 or newer.
201 A5) Are you sure your FTP _client_ correctly supports large files?
203 Q) Help! The built-in vsftpd listener is hanging or crashing!
204 A) A bug in this area is fixed in vsftpd v1.2.2. The problem has always existed
205 but seems to frequently trigger only on certain platforms. For example,
206 Fedora Core 1 - the suspected trigger is a glibc-2.3 platform, possibly in
207 combination with a NPTL-enabled kernel.
209 Q) Help! I'm using Solaris / Veritas and vsftpd is hanging!
210 A) Suspected bug with the Solaris / Veritas combination. With vsftpd-1.2.3
211 there is a possible workaround: no_log_lock=YES in your vsftpd.conf.5.
213 Q) Does vsftpd support SSL / TLS based encryption?
214 A) Yes, as of v2.0.0, this is supported for the control and data connections
215 (hurrah). You need a build of vsftpd with this support enabled, and then you
216 need to activate the ssl_enable setting. NOTE there are security considerations
217 with this support. Please make sure to read the ssl_enable section in the
218 vsftpd.conf.5 man page thoroughly before using.
220 Q) Help! I'm using FlashFXP and getting truncated files on download.
221 A) FlashFXP is buggy - particularly with SSL transfers. Upgrade to v3.0RC4
222 or newer, which is reported to be fixed.
224 Q) Help! I'm trying to build vsftpd, and I get an error along the lines of
225 "krb5.h: no such file or directory".
226 A) Yes, seems to be a problem with some RedHat setups. See
227 http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=111301 for details and
228 suggested workarounds.
230 Q) Help! I'm getting the error "OOPS: capset" when I try to connect to vsftpd.
231 A) This is an issue with SELinux enabled distributions. The solution is to
232 make sure the capability kernel module is loaded.
234 Q) Help! I'm getting the error "ftp: netin: Interrupted system call".
235 A) Seems to be a bug in ftp-tls, particularly with SSL transfers with
236 bandwidth limiting in effect.
238 Q) Help! When trying SSL transfers, users log in and are no longer restricted
239 to their home directory! They can browse the entire filesystem!
240 A) Most likely, your FTP client is in fact using the SSH protocol rather than
241 the FTP protocol - so sshd is in control and not vsftpd!
242 A) Of course, make sure you turn on the chroot_local_user option!!
244 Q) Help! I'm getting connections dropped whilst using gFTP for an SSL
245 connection.
246 A) The version of gFTP on my Fedora Core 10 installation appears to send the
247 "SIZE" command plain text during an SSL connection, which obviously breaks the
248 SSL connection.
250 Q) Help! SSL data connections are not working.
251 A) As of v2.1.0, vsftpd only accepts data connections that are reused sessions
252 of the control connection. This is a security measure. Unfortunately, not all
253 FTP clients reuse sessions (e.g. curl). You can disable this requirement by
254 changing require_ssl_reuse to NO.
256 Q) Help! My LDAP / mysql / etc. authentication and / or username lookup are
257 failing!
258 A) As of v2.2.0, the built-in sandboxing uses network isolation on Linux. This
259 may be interfering with any module that needs to use the network to perform
260 operations or lookups. Try changing isolate_network to NO.
262 Q) Blah.. blah..
263 A) For a good idea of what vsftpd can do, read the vsftpd.conf.5 man page
264 and the EXAMPLES.