📄 readme
字号:
Note: 'root' (uid 0) always has full filesystem access.If you want to chroot() everyone, but root, use the following flag:- '-A': chroot() everyone, but root.- '-b': Ignore parts of RFC standards in order to deal with some totallybroken FTP clients, or broken firewalls/NAT boxes.- '-B': Have the standalone server start in background (daemonization).- '-c <number of clients>': Allow a maximum of clients to be connected. Forinstance '-c 42' will limit access to simultaneous 42 clients. There is a50 client limit by default.- '-C <max connection per ip>': Limit the number of simultanous connectionscoming from the same IP address. This is yet another very effective way toprevent stupid denial of services and bandwidth starvation by a single user.It works only when the server is launched in standalone mode (if you use asuper-server, it is supposed to do that) . If the server is launched with'-C 2', it doesn't mean that the total number of connections is limited to 2.But the same client, coming from the same machine (or at least the same IP),can't have more than two simultaneous connections. This feature needs somememory to track IP addresses, but it's recommended to use it.- '-d': Send various debugging messages to the syslog. Don't use thisunless you really want to debug Pure-FTPd. Passwords aren't logged.Duplicate '-d' to log responses, too.- '-D': List files beginning with a dot ('.') even when the client doesn'tappend the '-a' option to the list command. A workaround for badlyconfigured FTP clients. If you are a purist, don't enable this. If youprovide hosting services and if you have lousy customers, enable this.- '-e': Only allow anonymous users. Use this on a public FTP site with noremote FTP access to real accounts.- '-E': Only allow authenticated users. Anonymous logins are prohibited.- '-f <facility>': Use that facility for syslog logging. It defaults to'ftp' (or 'local2' if you got an obsolete libc without that facility).Logging can be disabled with '-f none' .- '-F <fortune file>': Display a fortune cookie on login. The sentence isa random extract from the text file <fortune file>. This text file should beformatted like standard "fortune" files (fortunes are separated by a '%'sign on a single line) . Pure-FTPd has to be compiled with support forcookies (--with-cookie). If you just want a simple banner displayed beforethe login prompt, add the name of any text file here.- '-g <pid file>': Change the location of the pid file when the server isrun in standalone mode. The default is /var/run/pure-ftpd.pid .- '-G': Disallow renaming.- '-H': By default, fully-qualified host names are logged. To achieve this,DNS lookups are mandatory. The '-H' flag avoids host names resolution.("213.41.14.252" will be logged instead of "www.toolinux.com") . It cansignificantly speed up connections and reduce bandwidth usage on busyservers. Use it especially on public FTP sites. Also, please note thatwithout -H, host names are informative but shouldn't be trusted: no reversemapping check is done to save DNS queries.- '-i': Disallow upload for anonymous users, whatever directory permissionsare. This option is especially useful for virtual hosting, to avoid yourusers creating warez sites in their account.- '-I <timeout>': Change the maximum idle time. The timeout is in minutesand defaults to 15 minutes. Modern FTP clients are trying to fool timeoutsby sending fake commands at regular interval. We disconnect these clientswhen they are idle for twice (because they are active anyway) the normaltimeout.- '-j': If the home directory of a user doesn't exist, automatically createit. The newly created home directory belongs to the user and permissions areset according to the current directory mask. Only the home directory can becreated (so /home/john/./public_html won't work, but /home/john will) . Toavoid local attacks, the parent directory should never belong to an untrusteduser. Also note that you must trust whoever manages the users databases,because with that feature, he'll be able to create/chown directories anywhereon the server's filesystem.- '-k <percentage>': Don't allow uploads if the partition is more than<percentage>% full. For instance, "-k 95" will ensure your disks will neverget filled more than 95% by FTP. No need for the "percent" sign after thenumber.- '-K': Allow users to resume and upload files, but *NOT* to delete or renamethem. Directories can be removed, but only if they are empty. However,overwriting existing files is still allowed (to support upload resume) . Ifyou want to disable this too, add -r (--autorename) .- '-l <authentication>' or '-l <authentication>:<config file>': Adds a newrule to the authentication chain. Please read the "Authentication" section,later in this README file. It's an important section.- '-L <max files>:<max depth>': To avoid stupid denial-of-service attacks(or just CPU hogs), Pure-FTPd never displays more than 2000 files in responseto an 'ls' command. Also, a recursive 'ls' (-R) never goes further than 5subdirectories. You can increase/decrease those limits with the '-L' option.- '-m <cpu load>': Don't allow anonymous download if the load is above <cpuload> . A very efficient way to prevent overloading your server. Upload isstill allowed, though.- '-M': Allow anonymous users to create directories.- '-n <max files>:<max size>': If the server has been compiled with supportfor virtual quotas, enforce these quota settings for all users (exceptmembers of the 'trusted' group) . <max size> is in Megabytes. See the"virtual quotas" section later in this document.- '-N': NAT mode. Force ACTIVE mode. If your FTP server is behind a NAT boxthat doesn't support applicative FTP proxying, or if you use portredirection without a transparent FTP proxy, use this. Well... the previoussentence isn't very clear. Okay: if your network looks like this:(FTP server)-------(NAT/masquerading gateway/router)------(Internet)and if you want people coming from the internet to have access to your FTPserver, please try without this option first. If Netscape clients canconnect without any problem, your NAT gateway rulez. If Netscape doesn'tdisplay directory listings, your NAT gateway sucks. Use '-N' as a workaround.- '-o': Write all uploaded files to '/var/run/pure-ftpd.upload.pipe' sothat the 'pure-uploadscript' program can run. Don't enable that option ifyou don't actually use 'pure-uploadscript'.- '-O <format>:<log file>': Record all file transfers into a specific logfile, in an alternative format. Currently, three formats are supported: CLF(Apache-like), Stats and W3C.If you add '-O clf:/var/log/pureftpd.log' to your starting options,Pure-FTPd will log transfers in /var/log/pureftpd.log in a format similar tothe Apache web server in default configuration. If you use '-O stats:/var/log/pureftpd.log' to your starting options,Pure-FTPd will create log files in a special format, designed for statisticalreports. The Stats format is compact, more efficient and more accurate thatCLF and the old broken "xferlog" format.The Stats format is:<date> <session id> <user> <ip> <U or D> <size> <duration> <file><date> is a GMT timestamp (time()) and <session id> identifies the currentsession. <file> is unquoted, but it's always the last element of a log line."U" means "Upload" and "D" means "Download".Warning: the session id is only designed for statistics purposes. While it'salways an unique string in the real world, it's theoretically possible to haveit non unique in very rare conditions. So don't rely on it for criticalmissions.A command called "pure-statsdecode" can be used to convert timestamps intohuman-readable dates.The W3C format is enabled with '-O w3c:/var/log/pureftpd.log' .For security purposes, the path must be absolute (eg. /var/log/pureftpd.log, not ../log/pureftpd.log) . If this log file is stored on a NFS volume, don'tforget to start the lock manager (often called "lockd" or "rpc.lockd").- '-p <first port>:<last port>': Use only ports in the range <first port>to <last port> inclusive for passive-mode downloads. This is especiallyuseful if the server is behind a firewall without FTP connection tracking.Use high ports (40000-50000 for instance), where no regular server should belistening.- '-P <ip address or host name>': Force the specified IP address in reply toa PASV/EPSV/SPSV command. If the server is behind a masquerading (NAT) boxthat doesn't properly handle stateful FTP masquerading, put the ip addressof that box here. If you have a dynamic IP address, you can put the publichost name of your gateway, that will be resolved every time a new client willconnect.- '-q <upload ratio>:<download ratio>': Enable ratios for anonymous users.- '-Q <upload ratio>:<download ratio>': Enable ratios for everybody(anonymous and non-anonymous). Members of the root (0, something called'wheel') have no ratio.- '-r': Never overwrite existing files. Uploading a file whoose namealready exists cause an automatic rename. Files are called xyz, xyz.1, xyz.2,xyz.3, etc.Tip: if you compile with 'make AUTORENAME_REVERSE_ORDER=1' , the namingconvention will be reversed. Files will be called xyz, 1.xyz, 2.xyz, 3.xyz,etc.- '-R': Disallow users (even non-anonymous ones) usage of the CHMODcommand. On hosting services, it may prevent newbies from making mistakes,like setting bad permissions on their home directory. Only root can useCHMOD when -R is enabled.- '-s': The "waReZ protection". Don't allow anonymous users to downloadfiles owned by "ftp" (generally, files uploaded by other anonymous users) .So that uploads have to be validated by a system administrator (chown toanother user) before being available for download.- '-S [<ip address>,|<hostname>,] [<port>|<service name>]'. This option isonly effective when the server is launched as a standalone server.Connections are accepted on the specified IP and port. IPv4 and IPv6 aresupported. Numeric and fully-qualified host names are accepted. A servicename (see /etc/services) can be used instead of a numeric port number.- '-T <bandwidth>' and '-t <bandwidth>': Enable bandwidth limitation (seebelow) . <bandwidth> is specified in kilobytes/seconds. To set up separateupload/download bandwidth, the [<upload>]:[<download>] syntax is supported.- '-u <uid>': Don't allow uids below <uid> to log in. '-u 1' denies accessto root (safe), '-u 100' denies access to virtual accounts on most Linuxdistros.- '-U <umask for files>:<umask for dirs>': Change the file creation mask.The default is 133:022. If you want a new file uploaded by a user to only bereadable by that user, use '-U 177:077'. If you want uploaded files to beexecutable, use 022:022 (files will be readable -but not writable- by otherusers) or 077:077 (files will only be executable and readable by theirowner) . Please note that Pure-FTPd support the SITE CHMOD extension, so auser can change the permissions of his own files.- '-V <ip address>': Allow non-anonymous FTP access only on this specificlocal IP address. All other IP addresses are only anonymous. With thatoption, you can have routed IPs for public access and a local IP (like10.x.x.x) for administration. You can also have a routable trusted IPprotected by firewall rules and only that IP can be used to login as anon-anonymous user.- '-w': Support the FXP protocol only for authenticated users. FXP workswith IPv4 and IPv6 addresses.- '-W': Support the FXP protocol. FXP allows transfers between two remoteservers without any file data going to the client asking for the transfer.However:**************************************************************************** *FXP IS AN INSECURE PROTOCOL* (third-party hosts can steal the currentconnection) . In Pure-FTPd, specific precautions have been taken to reduceFXP insertion attacks. But if your FTP server serves private data: NEVER ALLOW FXP ACCESS TO UNTRUSTED HOSTS. YOU CAN PLAY WITH IT ON ANINTERNAL SERVER, BUT _DON'T_ GIVE FXP ACCESS TO ANONYMOUS INTERNET USERS.**************************************************************************** It's why FXP is disabled by default on Pure-FTPd unless youexplicitely enable it with '-W' or '-w'.- '-x': In normal operation mode, authenticated users can read/write filesbeginning with a dot ('.') . Anonymous users can't, for security reasons(like changing banners or a forgotten .rhosts) . When '-x' is used,authenticated users can download dot-files, but not overwrite/create them,even if they own them. That way, you can prevent hosted users from messing.qmail files. If you want to give user access to a special dot-file, create asymbolic link to the dot-file with a file name that has no dot in it and theclient will be able to retrieve the file through that link.- '-X': This flag is identical to the previous one (writing dot-files isprohibited), but in addition, users can't even *read* files and directoriesbeginning with a dot (like "cd .ssh") .****************************************************************************When used in conjunction with "-a", members of the trusted group can bypass'-x'/'-X' restrictions.****************************************************************************- '-y <max user logins>:<max anonymous logins>': This option onlyworks if the server has been compiled with --with-peruserlimits. Itrestricts the number of concurrent sessions the same user can have. A null value ('0') means 'unlimited'.Here's a concrete example:/usr/local/sbin/pure-ftpd -y 3:20 -c 15 -C 5 -BHere, we allow: * A max total of 15 sessions. * 5 connections max coming from the same IP address. * 3 connections max with the same user name. * 20 anonymous users max. With such a setup, a single user can't easily fill all slots. - '-Y 0': Disable the SSL/TLS encryption layer (default). '-Y 1': Accept both standard and encrypted sessions. '-Y 2': Refuse connections that aren't using SSL/TLS security mechanisms,including anonymous sessions. The server must have been compiled with--with-tls and a valid certificate must be in place to get this feature.See the README.TLS file for more info about SSL/TLS.- '-z': Allow anonymous users to read files and directories starting with adot ('.') .- '-Z': Try to protect customers against common mistakes to avoid yourtechnical support being busy with stupid issues. Right now, the '-Z' switchprevents your users against making bad 'chmod' commands, that would denyaccess to files/directories to themselves. The switch may turn on otherfeatures in the future. If you are a hosting provider, turn this on.If you prefer long options (GNU-style) over standard ones, the followingaliases are available. You can get this list at any time by typing'pure-ftpd --help' .--(switches sorted by ##standard switches## lexical order)---0 --notruncate-1 --logpid <file>-4 --ipv4only-a --trustedgid <gid>-A --chrooteveryone -b --brokenclientscompatibility -B --daemonize -c --maxclientsnumber <number>-C --maxclientsperip <number>-d --verboselog -D --displaydotfiles -e --anonymousonly -E --noanonymous
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -