Commands
From Wzdftpd
Contents |
Commands Reference
- site addip <user> <ip1> [<ip2> ...]
- Add IP to user.
site addip toto 127.*
This will allow user "toto" to connect from any ip beginning by "127."
To check ident when user is connecting, just add 'ident@' before the ip.site addip toto foobar@127.*
If you are a gadmin, you can only change users from your group.
- site adduser <user> <password> [<group>] [<backend>]
- Add a user, without any allowed ip. If group is specified, user will be added to the group (Note: only siteops can add users to a different group than their own group), otherwise the main group of the current user will be used.
User's homedir is determined using the value 'default_home' of the group. A default ratio is also set (1:3).
You MUST add an ip after.
ex:site adduser toto mypassword anonymous
If you are a gadmin, you can only add users from your group.
- site backend <command> <backend_name>
- Operations on backend. 'command' can be one of the following :
close: unload 'backend'. If you have no backend, or if backend is in use, the server will be in an unstable state !
commit: commits change to backend in a synchronous way. After the command, you can shutdown or reload the server in a safe way
init: loads a new backend. NO verifications are made - be sure of what you are doing!
reload: close and init a backend, without committing it. This command allows you to modify backend and reload modifications. Modifications should be made carefully, especially if users are logged!
Backend name is the short name of the backend, not the name of the file (e.g: "plaintext", "mysql").site backend commit plaintext
This is a DANGEROUS command
- site chacl <user> <mode> <file> [<file2> ...]
- Change access rights on a file or directory for a specific user/group.
Always prefer the site chmod command when you can.
- site change <user> <field> <value>
- Change a field for a user.
If you are a gadmin, you can only change users from your group (except homedir, flags, and groups).
| Field | Description |
|---|---|
| flags | Set user's flags. This is similar to the site flags command For flags info see Flags Table. You can use '+flag' or '-flag' to add or remove flags, otherwise it will replace all existing flags. |
| group | Add / remove user from group. site chgrp command is better, as it can handle several group changes in one command |
| homedir | This will change the user's homedir. |
| leech_slots | Number of leech accounts a gadmin is allowed to add (done by "site change user ratio 0"). (GAdmin only) |
| max_idle | Set the maximum idle time for this user. See the site idle command |
| max_ul | Upstream bandwidth control in bytes/sec (0 = Unlimited). |
| max_dl | Same but for downloads. |
| name | This will change the user's login name. The modification is immediate, even if user is currently logged ! |
| num_logins | Maximum number of simultaneous logins. |
| pass | This will change the user's password. This is similar to the site chpass command |
| perms | Set user's default perms (All: 0xffffffff, retrieve only: 0x03). This command will change. See Permissions |
| ratio | User ratio |
| tagline | User's tagline. This is similar to the site tagline command |
| user_slots | Number of users a gadmin is allowed to add. (GAdmin only) |
- site changegrp <user> <group1> [<group2> ...]
- For each group in list, add user to group or removes it if he/she already belongs to group.
site changegrp toto guest admin
This will add user "toto" to group "admin" and remove "toto" from group "guest", if user had group "guest" before.
- site checkperm <user> <file> <rights>
- Check permission for a specific user.
site checkperm toto my_file RIGHT_RETR
See Permissions.
- site chgrp <group> <file1> [<file2> ...]
- Change file group
site chgrp admin dir1
This will give dir1 to group "admin", but not its content!
- site chmod <mode> <file1> [<file2> ...]
- Change permissions for "user" on files. Permissions are unix-like.
site chmod rwx dir1
is equivalent tosite chmod 755 dir1
- site chown <user> <file1> [<file2> ...]
- Change file owner
site chown toto dir1
This will give dir1 to user "toto", but not its content!
- site chpass [<user>] <password>
- Change user password. ex:
site chpass toto newpassword
This will change the password to 'newpassword' for the user 'toto'.site chpass toto {cert}will use certificates authentication (the password specified when logging is ignored). % denotes any password
If you are a gadmin, you can only change users from your group.
If no user name is specified, it changes your own password. ex:site chpass newpassword
See also: chapter on authentication for details.
- site chratio <user> <ratio>
- Change user ratio. ex:
site chratio toto 3
This will change the ratio to 1:3 for the user 'toto'.
A ratio of 0 means no ratio (leech access).
If you are a gadmin, you can only change users from your group. To give a ratio of 0 you need to have a free leech slot. If a gadmin sets back a ratio from 0 to a non-zero value, he gets back his leech slot.
- site close
- Close server for everyone except siteops.
This is mainly designed to temporarily close server for maintenance.
See the site reopen command
- site color
- Toggle use of color in server replies.
WARNING : This can kill many clients (especially graphical ones)!
- site delip <user> <ip1/slot1> [<ip2/slot2> ...]
- Delete ip from user. You can also use the ip number (given by "site who").
site delip toto 127.0.0.1
This will remove the ip "127.0.0.1" from user "toto".site delip toto 1
This will remove ip #1 in ip list from user "toto"
site delip toto 127.*This will remove the exact ip "127.*", and not all ip beginning by "127."
If an user has no authorized ip, he cannot login
If you are a gadmin, you can only change users from your group.
- site deluser <user>
- Delete a user, may be re-added with site READD
site deluser toto
This will set the flag DELETED (D) for the user 'toto'. In order to fully delete this user you will need to do a 'site purge'.
If you are a gadmin, you can only change users from your group.
- site flags [<user>] [<newflags>]
- Display a user's flags.
site flags
This will show your own flagssite flags toto
This will show flags of user toto.
If a second argument is provided, it will be used to change flags for user. You can use '+flag' or '-flag' to add or remove flags, otherwise it will replace all existing flags.
*NOTE* If you have flag O then you do NOT want flag G
If you are a gadmin, you can only change users from your group.
| Flagname | Flag | Description |
|---|---|---|
| SITEOP | O | User is siteop |
| GADMIN | G | User is groupadmin of his/her first public group* |
| DELETED | D | User is deleted |
| IDLER | I | User is allowed to idle forever |
| SEE_IP | s | User is allowed to see other's ip |
| SEE_HOME | t | User is allowed to see other's home |
| HIDDEN | H | User will not appear in site who |
| ULTRAHIDDEN | h | User will not appear anywhere, even for siteops |
| TLS | k | User will be forced to use TLS/SSL connections |
| TLS_DATA | K | User will be forced to use TLS/SSL data connections |
| ANONYMOUS | A | User cannot make any modifications |
| COLOR | 5 | Enable the use of color (toggle with site color) |
| FULLPATH | f | Show the complete (system) path to the user (WIN32 only) |
| FXP_DENIED | F | User is not allowed to use site-to-site transfers (aka FXP) |
- site free
- Show free space in the current dir.
- site ginfo <group>
- Show detailed info on a group.
site gsinfo idlers
This will show detailed info (members, uploaded/downloaded files) on group 'idlers'
- site give <user> <kbytes>
- Gives credits to user (Taken from you)
site give toto 100000
This will give around 100mb of credits to user 'toto'
- site groups
- List groups and shows detailed informations
- site grpadd <group> [<backend>]
- Add a group. (Note: only siteops can add groups).
Group's defaultpath is determined using the value 'default_home' of your group, or your homedir if you have no group.
You MUST check all values after.site grpadd newgroup
- site grpaddip <group> <ip>
- Add IP to a group.
site grpaddip idlers 127.*
This will allow users from group "idlers" to connect from all ip beginning by "127."
To check ident when user is connecting, just add 'ident@' before the ip.site grpaddip idlers foobar@127.*
- site grpchange <group> <field> <value>
- Change a field for a group.
| Field | Flag |
|---|---|
| name | This will change the group name. The modification is immediate, even if a user is currently logged ! |
| tagline | Group's tagline (description message) |
| homedir | This will change the group's default homedir. |
| max_idle | Set the maximum idle time for this group. |
| perms | Set group's default perms (All: 0xffffffff, retrieve only: 0x03). This command will change |
| max_ul | Upstream bandwidth control in bytes/sec (0 = Unlimited). |
| max_dl | Same but for downloads. |
| ratio | Group default ratio |
| num_logins | Maximum number of simultaneous logins. |
- site grpdel <group>
- Delete a group
site grpdel idlers
Unlike site deluser, the deletion is definitive (you can't re-add deleted groups, so be careful).
- site grpdelip <group> <ip/slot>
- Delete ip from group. You can also use the ip number (given by site gsinfo).
site grpdelip idlers 127.0.0.1
This will remove the ip "127.0.0.1" from group "idlers".site grpdelip idlers 1
This will remove ip #1 in ip list from group "idlers"
"ip" can contain wildcards, but they are not interpreted.site grpdelip idlers 127.*
This will remove the exact ip "127.*", and not all ip beginning by "127."
- site grpkill <group>
- Kill all users from a group
site grpkill idlers
This will kick all members of the group 'idlers'.
User running the command will not be kicked even if member of the group.
- site grpratio <group> <ratio>
- Change group ratio
site grpratio idlers 3
This will change the ratio to 1:3 for the group 'idlers'.
A ratio of 0 means no ratio (leech access).
Group ratio is used only when adding users in this group
- site grpren <groupname> <newgroupname>
- Renames a group
site grpren ftp new_ftp
This will change the group name 'ftp' to 'new_ftp'.
All users in group 'ftp' will now automatically belong to 'new_ftp'.
- site gsinfo <group>
- Show system info on a group.
site gsinfo idlers
This will show system info (default home, ratio) on group 'idlers'
- site help
- Display helpscreen.
- site idle [<idletime>]
- This sets your idle-time (the amount of time you can be online without doing something) for this session only (unless committed to backend). Max idle-time is 7200 sec.
site idle
This will show your current idle-time settings
site idle 3600
This will set your idle-timeout to 3600 sec.
"site idle 0" for users that have the idle flag (I) will allow them to idle forever.
- site invite <irc_nick>
- Tells the sitebot to invite irc_nick on sitebot's channel.
- site kick <user>
- Kick a user off the site.
site kick toto
This will kill all connections for the user 'toto'
- site kill <pid>
- Kill a PID
site kill 345
This will kill pid #345 (if it belongs to a wzdftpd user)
- site killpath <vfs_path> | -r <real_path> | --real <real_path>
- Kills users who are in a path and subdirectories.
It won't kill the user running it.
site killpath /FILES
This will kill users in /FILES
site killpath -r /home/FILES
This will kill users in /home/FILES
Note: users are not killed instantly (0.8.0), this will changed in later versions
- site link create <dir> <linkname>, site link remove <linkname>
- Create or removes symbolic links.
Both paths are given relative to the current user homedir.
NOTE: if the underlying filesystem supports symbolic links, they will be used, otherwise an abstraction layer is provided to have similar behavior. Most unix filesystems support symbolic links.
- site msg <show> | new <line> | append <line> | convert <file> | delete
- Manage directory message file
site msg show
- site perm <show> [<name>] | add <name> <perms> | change <name> <perms> | remove
- Manage command permissions
site perm show site
This will show permissions for all site commands
- site purge [<user>]
- Remove deleted users, site READD will not work for purged users.
If run without arguments, purge ALL deleted users
site purge toto
This will erase definitively user 'toto' (only if it has been deleted).
If you are a gadmin, you can only purge users from your group (that is, if you are giving access to this command in your config file).
- site readd <user>
- Re-add a user.
site readd toto
This will remove the DELETED flag for user 'toto'
If you are a gadmin, you can only change users from your group.
- site reload
- Reload config file.
site reload
This will reload config file (wzd.cfg by default)
This is a DANGEROUS command
- site reopen
- Re-open server for everyone.
Useful after server has been closed with the site close command
- site rules
- Display local site rules.
- site showlog [number_of_lines]
- Display the most recent log messages (10 by default). The optional argument is the number of log messages to display (by default, the last 100 messages are stored in memory).
- site shutdown
- Shutdown the server. Users that are currently logged are not kicked, and your connection is not closed. You will need to start the server on the machine.
- site su <user>
- Changes you current user ID, resulting in a user change. This is similar to the 'su' command on unix systems. This allow becoming a user without knowing his password and logging in as this user.
site su foobar
This will change your ID to become user foobar.
If you are a gadmin, you can only become a user from your group.
Unlike other ftpds, this is NOT emulation, you are really becoming the other user, and there is no way to turn back identity. This is why, by security, this command is restricted to siteops, and will be logged every time you use it.
- site swho
- Shows detailed information about users online.
- site tagline [<tagline>]
- Shows/Sets your tagline
site tagline
This will show your current tagline
site tagline my new tagline
This will set your tagline to 'my new tagline'
If you are a gadmin, you can only change users from your group.
- site take <user> <kbytes>
- Removes credits from user (this is not the opposite from site give, you are NOT granted from the same account)
site take toto 100000
This will remove 100mb of credits from user 'toto'
- site user <user>
- Show detailed informations for a user.
- site users
- List users and shows their group and detailed informations
- site vars get <variable>
- Access server variables. See the Config Variables list.
- site vars_group get/set <groupname> <variable>
- Display or change a value for a group. See the Group Variables list.
- site vars_user get/set <username> <variable>
- Display or change a value for a user. See the User Variables list.
- site uptime
- Display server uptime.
- site version
- Display server version.
- site vfsadd |/ftp/vfsroot|/physical/path| [auth]
- Add new VFS entry. See Virtual File System section for details.
site vfsadd |/home/ftp/etc|/etc/| +O
The new entry is NOT saved to config file !
- site vfsdel /ftp/vfsroot
- Remove a VFS entry.
site vfsdel /home/ftp/etc
Changes are NOT saved to config file !
- site vfsls
- List VFS entries.
- site who
- Show users online.
- site wipe [-r] <file1> [<file2> ...]
- Delete file (or directory). The difference with the standard removal functions is that the uploader does not loose credits and upload stats for the removed file.
To remove a directory and all subdirectories recursively, you can specify the -r option.
Be careful, this command is quite dangerous !
- xcrc "filename" [startpos length [start_crc]]
- Gives CRC32 Checksum of the file
xcrc "1mB"
This will return the crc32 of the file
xcrc "1mB" 100 1500
This will return the crc32 of the file, only on the portion starting at 100, and on 1500 bytes.
xcrc "1mB" 100 1500 FE7F5BCE
This will do the same thing but with a starting crc of 0xFE7F5BCE
- xmd5 "filename" [startpos length]
- Gives MD5 Checksum of the file
xmd5 "1mB"
This will return the MD5 of the file
xmd5 "1mB" 100 1500
This will return the MD5 of the file, only on the portion starting at 100, and on 1500 bytes.
