Site commandsThese special server commands are specific to OpenFTPD, they do not
appear in other ftp servers. Fortunately, the FTP protocol defines
a "SITE" command, under which you can implement server/site
specific commands. To get a list of the site specific commands, issue a "SITE HELP"
command in your ftp client. Some FTP clients do not support the "SITE"
command. In this case, use "QUOTE SITE" instead. If your
FTP client doesn't even support the "QUOTE" command, throw
it away and get a better one !!! Another problem is that some UNIX
FTP clients limit the numer of parameters for the "SITE"
command. Again, use "QUOTE SITE" instead. The site specific commands that OpenFTPD defines are mostly for superusers
to maintain the running server. However, a few commands are also available
to normal users.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ADDGRP *
This command is used to add a new group. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ADDIP *
This command is used to add a new ip mask to an user. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ADDGROUPOP *
This command is used to grant groupop status and all default groupop permissions to an user. You can use the DELGROUPOP command to revoke this permission. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ADDNUKER *
This command is used to grant nuke permission to an user. You can use the DELNUKER command to revoke this permission. With this command the right R_NUKE is given to the user. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ADDSITEOP *
This command is used to grant siteop status and all default siteop permissions to an user. You can use the DELSITEOP command to revoke this permission. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ADDUNDUPER *
This command is used to grant undupe permission to an user. You can the DELUNDUPER command to revoke this permission. With this command the right R_UNDUPER is given to the user. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ADDUSER *
This command is used to add users with one line while logged in the
ftp daemon. (As an alternative to the site user commands) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
BIND *
This command binds a service or admin port to a new port number. Changes take effect immediately, active sessions are not affected. (a = adminport, p = port, s = port2) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CHGRP *
This command changes the primary group of an user. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CHMOD +
|
| Syntax | chmod {ugo*}{+|-|=}{acgoplmn*} [<directory>] chmod {ugo*}{+|-|=}{rwx} <file> chmod d{+|-|=}h [<directory>] |
| Example | chmod g+gcl testdir chmod go-mra chmod u=* chmod *+r testfile chmod d=h dirtohide |
This command changes the access permissions of a directory or a file.
The second parameter is the directory/file. If it is omitted, the
current directory is used.
The first parameter consists of three parts. The first one (ugo*)
specifies for who the permissions are to change. It is possible to
give more than one character (see examples).
| u | user |
| g | group |
| o | others |
| * | all |
| d | directory |
The second part (+-=) says how to change the permissions.
| + | grant permission |
| - | revoke permission |
| = | set permission |
The third part (acgoplm* for directories or rwx for files) gives the
permission(s). For more than
one type of permission, give the appropriate characters as a string
(see examples).
| a | access |
| c | change to dir |
| g | get file |
| o | overwrite file |
| p | put file |
| l | list dir |
| m | make subdir |
| n | remove directory |
| * | everything |
| h | hidden (only for directories) |
Everybody who has no permission to cd to to a hidden directory does
not see it in listings. Also, actions regarding hidden directories
(e.g. MKDIR, UPLOAD, DOWNLOAD) are not shown by the SITE W command.
Access permission includes four rights: change mode, delete file, rename file and remove directory.
| r | read file |
| w | overwrite/delete/rename file |
| x | change file permissions |
This command works like CHMOD, but changes permissions for all subdirectories below the specified directory (=recursive). Works for files, too.
| Syntax | chown [<user>]:[<group>] [<directory>|<file>] |
| Example | chown user_x testdir chown :users filexxx chown user_x:users |
This command changes the ownership of a directory or file. It can
change both user and group. The tuple <user>:<group> is
the first parameter. You can leave out either, but not both. If one
is left out, only the other is changed, e.g. if you do not specify
a user, only the group ownership is changed.
If you do not specify a file or directory, the current directory is assumed.
This command works like CHOWN, but changes ownership for all subdirectories below the specified directory (=recursive). Works for files, too.
| Syntax | close |
| Example | close |
This command closes the server temporarily. All normal user connections are closed and only the superusers remain logged in. From now, only superusers may log in. The server can be re-opened for normal users with the open command.
| Syntax | color |
| Example | color |
Enables / Disables color support for the user. It acts like a switch to toggle between b/w and colormode. Colors are sent as standard ansi-color-sequences to the ftp-client. See the definition of color-variables here.
| Syntax | count |
| Example | count |
Counts all users who are currently logged in, except the invisible ones.
| Syntax | del <username> {<filename>|<directory>} |
| Example | del testuser somedir |
This command deletes a file or a directory, this is much faster than deleting using normal dele commands.
| Syntax | delgrp <groupname> |
| Example | delgrp users |
This command is used to remove a group.
| Syntax | delip <name> <n> |
| Example | delip dumbo 1 |
This command is used to remove the ip mask with number <n> from an user. To see the ip information of an user use the SITE USER LIST <user> command
| Syntax | delgroupop <name> |
| Example | delgroupop dumbo |
This command is used to revoke groupop permissions. If the user does not have these permissions nothing happens.
| Syntax | delnuker <name> |
| Example | delnuker dumbo |
This command is used to revoke nuke permissions. If the user does not have this permission nothing happens.
| Syntax | delsiteop <name> |
| Example | delsiteop dumbo |
This command is used to revoke siteop permissions. If the user does not have these permissions nothing happens.
| Syntax | delunduper <name> |
| Example | delunduper dumbo |
This command is used to revoke undupe permissions. If the user does not have this permission nothing is happening.
| Syntax | deluser <name> |
| Example | deluser dumbo |
This command is used to delete an user. You can't delete yourself.
| Syntax | disable <username> |
| Example | disable lamer |
This command disables an user account. It can be enabled again with
the ENABLE command. The server refuses login
attempts to disabled accounts.
| Syntax | dump <area> |
| Example | dump check |
Dumps debug information. Available areas are: cdpath, check, config, dcheck, dirdcheck, delcheck, dshortcut.
| Syntax | enable <username> |
| Example | enable testuser |
This command enables a disabled user account again.
| Syntax | exec <command> [<arguments>] |
| Example | exec ls -al |
This executes a command on the server. The result is sent back over the control connection, i.e. you get a sequence of 200- lines. When the command finishes, the exit code is displayed. You can not run interactive commands such as a shell. This command is very powerful so choose your siteops wisely and don't run OpenFTPD as root.
| Syntax | ff <wildcard> |
| Example | ff file*.zip |
This searches the current directory and all subdirectories from the current for certain files. All files and directories matching the given wildcard are displayed with the full path.
| Syntax | ginfo [<group_information>] |
| Example | ginfo our group rules |
This command views or changes the group information. Called without parameters, the group information of your primary group is displayed. Only superusers, siteops, groupops, or users with the right R_GROUP_EDIT may set the group tagline.
| Syntax | give <username> <credits in mb> |
| Example | give lamer 100 |
Give credits to other users. Siteops and superusers are not restricted, groupops need the right R_USER_EDIT_CREDITS. Normal users can give the credits they own and normal leech users are not allowed to use this command.
| Syntax | group <subcommand> |
| Example | group add megausers group list group remove megausers |
subcommand syntax description:
| add <name> [<gid>] | add new group |
| change <name> {<var>=<value>} | change group |
| list <name> | list all or especifed group(s) |
| remove <name> | remove group |
| rights | show the default rights for group member |
variables that can be set with the change subcommand:
| name=<s> | name of the group |
| gid=<n> | goup id |
| limit=<n> | default limit (ratio) for group members |
| credit=<n> | default |
| dl_max=<n> | maximum download speed |
| dl_min=<n> | minimum download speed |
| ul_max=<n> | maximum upload speed |
| ul_min=<n> | minimum upload speed |
| logins=<n> | default number of logins |
| info=<s> | group infoline |
| maxlogins=<n> | maximum simultanous logins of the WHOLE group |
| rights[+|-]=<n> | default rights for group members |
| slots=<n> | number of maximum group members |
| ident=<s> | IP range + ident for all group members |
| umask=<n> | this overrides umaskuser |
Every time a groupop adds a new user to the group he will get the
defined values for the group. For example if the limit of the group
is 33, then the new user will have limit 33 too and the groupop should
not be able to change it.
With this command you can modify groups. Every group has a number
(gid) and a name. Do not use the number -1 as gid, because it has
a special meaning. The maximum length for a name is 9 characters.
| Syntax | groups [<username> [{+|-}<group>]] |
| Example | groups user_x groups lamer +lamers groups testuser -staff |
It is possible for a user to be in more than one group. The user must
be at least in one group, this one is called primary group. This is
the group in which the user is now. Furthermore, he can be in up to
eight secondary groups. When a user uploads a file or creates a directory,
the directory always gets the primary group.
Called without parameters, this command shows the groups the user is in. The superuser can use this command to add/remove users to/from groups. He can also look in which groups the user is by issuing this command without the second parameter.
| Syntax | help [<site_command>] |
| Example | help chmod |
This command displays help for a certain site command, or a list of
all site commands when no parameter is given.
| Syntax | info [<user_information>] |
| Example | info my_info |
This command views or changes the user information. Called without parameters, the current user information is displayed. Every user can change his user information by typing it as the second parameter.
| Syntax | ipban list add <ip address> del <ip address> reset <allow|deny|all> |
| Example | ipban list ipban add 123.123.123.123 ipban reset allow |
You can use this command to view or manpilatate the banned IP addresses from the traceroute check. After a check, the checked address is either stored as allowed or forbidden but with this command you are able to unban addresses or even ban them manually without check before. You can use this command without enabled traceroute compile option but then only addresses you add manually are used.
| Syntax | kick <username> |
| Example | kick lamer |
This command lets you kick a logged in user from the server. This
is useful when you want to disable a user account and the is logged
in at the moment.
| Syntax | kill <pid> |
| Example | kill 123 |
This command lets kill a user connection by process id. You can use the SITE SWHO command to see the pid of a connection.
| Syntax | lgrp <groupname> |
| Example | lgrp users |
This command lists all members of a given group. Normal users without the necessary rights can only see themself.
| Syntax | mod [<directory>|<file>] |
| Example | mod xdir mod yfile |
This displays the permissions for the specified directory or file. This command is only available for directories you have cd permission to.
| Syntax | nuke {<filename>|<directory>} <factor> <reason> |
| Example | nuke lamedir 1 just crap nuke lamefile 2 throw away |
Use the nuke command to reduce the file owners credits by the formula nukesize = filesize * factor * user's ratio. for the current directory and everything below (recursive). This command is used to punish users who are uploading files that do not match the rules of your site. A nuke with factor 1 would always remove the complete credits the uploader got for the files but you can use higher values for punishment. A nuke.log file is created in a directory and an included script (nuke.pl) for irc announcement and directory rename is called if you like. All users with the R_NUKE right and superuser/siteops are allowed to nuke.
| Syntax | open |
| Example | open |
This re-opens the server after it was closed with the close command.
| Syntax | passwd <new_password> [<username>] |
| Example | passwd fool1234 passwd dubbydoo user_1 passwd someone - |
With this command the password can be changed. Every user can change his own password, but only the superuser can change passwords of other users. In the first example, a user changes his password to "fool1234". The second example can only be performed as superuser. Here, the superuser changes the password for "user_1" to "dubbydoo". Password "-" means to clear the password.
| Syntax | reg set <key> <value> reg del <key> reg get <key> reg list |
| Example | reg set private on reg list |
With this command you can access the registry. "list" lists all keys and its values, "del" deletes a key, "set" sets a key to a certain value (and creates it if it does not exist), "get" gets the value of a single key.
| Syntax | rights [<user>] |
| Example | rights rights dumbo |
With this command you view your own (if called without parameter) or a given user's rights. Normal users can only view their own rights.
| Syntax | run <script> [<parameters>] |
| Example | run test param1 param2 param3 |
Users can run scripts/programs. The output of the script is shown as result. Scripts are placed under bin/ in the standard tree. Users can run scripts which are either in the directory of their group, or in the parent directory. The group directory is searched first for a script. The parameters are passed to the script via environment variables.
| Syntax | section change <section> <user> <var>=<value> section list <section> <day|week|month|year|total> section reset <section> <all|up|down|credit> [{<all|total|year|month|week|day>}] |
| Example | section list mp3 week section change mp3 dumbo mbcred+=100 section reset video all all |
Use the section command to change, reset or list the section stats.
available variables for the change subcommand:
| fup[+|-]=<n> | files uploaded |
| fdown[+|-]=<n> | files downloaded |
| fyup[+|-]=<n> | files uploaded in current year |
| fydown[+|-]=<n> | files downloaded in current year |
| fmup[+|-]=<n> | files uploaded in current month |
| fmdown[+|-]=<n> | files downloaded in current month |
| fwkup[+|-]=<n> | files uploaded in current week |
| fwkdown[+|-]=<n> | files downloaded in current week |
| fdup[+|-]=<n> | files uploaded in today |
| fddown[+|-]=<n> | files downloaded today |
| up[+|-]=<n> | megabytes uploaded |
| down[+|-]=<n> | megabytes downloaded |
| kbsup[+|-]=<n> | upload speed |
| kbsdown[+|-]=<n> | download speed |
| wkup[+|-]=<n> | megabytes uploaded this week |
| wkdown[+|-]=<n> | megabytes downloaded this week |
| kbswkup[+|-]=<n> | upload speed this week |
| kbswkdown[+|-]=<n> | download speed this week |
| mup[+|-]=<n> | megabytes uploaded this month |
| mdown[+|-]=<n> | megabytes downloaded this month |
| kbsmup[+|-]=<n> | upload speed this month |
| kbsmdown[+|-]=<n> | download speed this month |
| yup[+|-]=<n> | megabytes uploaded this year |
| ydown[+|-]=<n> | megabytes downloaded this year |
| kbsyup[+|-]=<n> | upload speed this year |
| kbsydown[+|-]=<n> | download speed this year |
| Syntax | sec list|set <section id> [<key> <value>] |
| Example | sec list sec list 1 sec set 0 internal_dupecheck on |
This command is used by siteops to change the section configuration online without editing the config files in etc/sections manually.
| Syntax | setginfo <groupname> <group information> |
| Example | setginfo ind the independent users |
This command is used by siteops to change group taglines, which may contain spaces now.
| Syntax | setinfo <username> <user information> |
| Example | setinfo dumbo i am the greatest |
This command is used by siteops to change other users taglines, which may contain spaces now.
| Syntax | shutdown |
| Example | shutdown |
This is for closing down the server. All connections will be closed immediately, also the connection to the superuser that issued this command. After that, the server process terminates. You can also shut down the server by a kill command from a shell.
| Syntax | stats [<user>] |
| Example | stats stats dumbo |
This command shows you the section stats of yourself or a given user if you have the permission to list other users. To view the total stats (all sections together) use the SITE LUSER <user> commmand
| Syntax | swho |
| Example | swho |
This displays a more detailled list of all users that are currently logged in the server. This command is only available for siteops/superuser and you'll see the connection pid and the ip of the connected users.
| Syntax | take <username> <credits in mb> |
| Example | take dumbo 100 |
Siteops can use this command to remove credits from an user.
| Syntax | unnuke <directory> <reason> |
| Example | unnuke somedir damn i still need it |
Use this to undo a nuke done with SITE NUKE. You can't unnuke directories that were not nuked before because the nuke.log file is needed to read the original nuke factor and other stuff. All users with the R_NUKE right and superuser/siteops are allowed to unnuke.
| Syntax | uptime |
| Example | uptime |
This will show you how long your site is already running.
| Syntax | user <subcommand> usr <subcommand> |
| Example | user add new_user template user addsu new_su user change new_su uid=99 gid=2 ip0=*.*.*.* user list -nd group_x user remove new_su |
subcommand syntax description
| add <name> | add a new user (without any settings) |
| add <name> <template> | add new user with a template |
| addsu <name> [<template>] | add new superuser (from template) |
| list [-<options>] [ <groupname>] | list user(s) Options: a=anonymous, d=disable, n=normal, c=color, r|s=root, t=template, g=groupop, o=siteop, p=nopassch, l=leech |
| change <name> { <var>=<value> } | change user settings |
| remove <name> | remove a user |
| show <username> | show user details |
With the change command you can modify users. The add and addsu commands
let you create a new user/superuser. When a template is given, the
server creates the new user/superuser from this template. Otherwise
the user gets default values for all his attributes. With change you
can change user attributes.
variables that can be set with the change subcommand:
| name=<s> | username |
| uid=<n> | user id |
| gid=<n> | id of primary group |
| group=<s> | name of the primary group |
| info=<s> | tagline |
| limit=<n> | upload / download limit (ratio) in % |
| credit[+|-]=<n> | credit in bytes |
| mbcred[+|-]=<n> | credit in megebytes |
| ip[0-9]=<r> | ip ranges (set slot by index) |
| ip<+|->=<r> | ip ranges (add / remove) |
| class=[a|g|n|o|r|s|t] | set userclass (a=anonymous, g=groupop, n=normal, r|s=superuser, t=template, o=siteop) |
| flags[+|-]={c|d|i|p|*|-} | add remove flags (c=color, d=disabled, i=invisible, p=fixed password, *=all flags, -=no flags |
| logins=<n> | number of simultanous logins |
| ul_min=<n> | minimum upload speed in kB/s |
| ul_max=<n> | maximum upload speed in kB/s |
| dl_min=<n> | minimum download speed in kB/s |
| dl_max=<n> | maximum download speed in kB/s |
| passwd=<s> | password |
| rights<+|->=<rights> | give / revoke rights |
| fup[+|-]=<n> | files uploaded |
| fdown[+|-]=<n> | files downloaded |
| fyup[+|-]=<n> | files uploaded in current year |
| fydown[+|-]=<n> | files downloaded in current year |
| fmup[+|-]=<n> | files uploaded in current month |
| fmdown[+|-]=<n> | files downloaded in current month |
| fwkup[+|-]=<n> | files uploaded in current week |
| fwkdown[+|-]=<n> | files downloaded in current week |
| fdup[+|-]=<n> | files uploaded in today |
| fddown[+|-]=<n> | files downloaded today |
| mbup[+|-]=<n> | megabytes uploaded |
| mbdown[+|-]=<n> | megabytes downloaded |
| kbsup[+|-]=<n> | upload speed |
| kbsdown[+|-]=<n> | download speed |
| wkup[+|-]=<n> | megabytes uploaded this week |
| wkdown[+|-]=<n> | megabytes downloaded this week |
| kbswkup[+|-]=<n> | upload speed this week |
| kbswkdown[+|-]=<n> | download speed this week |
| mup[+|-]=<n> | megabytes uploaded this month |
| mdown[+|-]=<n> | megabytes downloaded this month |
| kbsmup[+|-]=<n> | upload speed this month |
| kbsmdown[+|-]=<n> | download speed this month |
| yup[+|-]=<n> | megabytes uploaded this year |
| ydown[+|-]=<n> | megabytes downloaded this year |
| kbsyup[+|-]=<n> | upload speed this year |
| kbsydown[+|-]=<n> | download speed this year |
| fnuked[+|-]=<n> | files nuked |
| fdnuked[+|-]=<n> | files nuked today |
| fwknuked[+|-]=<n> | files nuked this week |
| fmnuked[+|-]=<n> | files nuked this month |
| fynuked[+|-]=<n> | files nuked this year |
| tnuked[+|-]=<n> | times nuked |
| tdnuked[+|-]=<n> | times nuked today |
| twknuked[+|-]=<n> | times nuked this week |
| tmnuked[+|-]=<n> | times nuked this month |
| tynuked[+|-]=<n> | times nuked this year |
| cnuked[+|-]=<n> | credits nuked (in MB) |
| cwknuked[+|-]=<n> | credits nuked (in MB) this week |
| cmnuked[+|-]=<n> | credits nuked (in MB) this month |
| cynuked[+|-]=<n> | credits nuked (in MB) this year |
| cdnuked[+|-]=<n> | credits nuked (in MB) today |
| mnuked[+|-]=<n> | megabytes nuked |
| mdnuked[+|-]=<n> | megabytes nuked today |
| mwknuked[+|-]=<n> | megabytes nuked this week |
| mmnuked[+|-]=<n> | megabytes nuked this month |
| mynuked[+|-]=<n> | megabytes nuked this year |
With remove you can delete a user. If the user is logged in at the
moment, he is logged out immediately.
| Syntax | users |
| Example | users |
Displays the userlist. Only a shortcut to SITE USER LIST. Users without R_USER_LIST can only see themself.
| Syntax | traffic |
| Example | traffic |
Displays the network traffic statistic of your OpenFTPD server.
| Syntax | version |
| Example | version |
This displays the server version.
| Syntax | w who |
| Example | w |
This displays a list of all users that are currently logged in the server.