API/User commands

User commands
The user API module manages shell and ftp users (although note that the user-list_users command will also list mail users).

user-add_user
Adds a user (of type ftp, sftp, or shell). If you do not specify a password, then a password will be randomly generated and displayed in the result. Otherwise the result will just display ******** for the password. A Service token will also be returned (see Service Control Commands).

Values:

type : the type of user; can be ftp, sftp, or shell username : the desired username for the new user gecos : the Full Name for this user, like John Smith (this field cannot be blank) server : the home for the user (the shared server or ps). Required. shell_type : the type of shell for the user (bash, tcsh, ksh, or zsh). only required if the type is shell password : (optional) the password for the new user. Will be randomly generated if not specified. enhanced_security : (optional) set to 1 to enable Enhanced User Security (set to 0 or leave blank to disable)

Result:

success username	password	token testuser123	********	gcnaBcD12eFgH34iJkL

Possible Errors:

no_type no_username no_gecos no_server no_shell_type invalid_type invalid_shell_type invalid_server invalid_username (specific error after a tab) user_exists invalid_gecos (specific error after a tab) invalid_password (specific error after a tab)

user-list_users
Dump a list of all users (including ftp, shell, anonymous ftp, backup, and mailboxes) on all accounts you have access to. Passwords are no longer available via this API command.

Values:

(none)

Result:

success account_id	username	type	shell	home	password	disk_used_mb	quota_mb	gecos 1	anftp	ftp	/etc/ftponly	machine.dreamhost.com	0	671744	An FTP user 1	b1	backup	/usr/bin/rssh	backup.dreamhost.com	0	671744	Account #1 Backup User 1	blah	shell	/bin/bash	machine.dreamhost.com	0	671744	Blah Shell 1	josh@blah.com	mail	/etc/poponly	smaug.dreamhost.com	0	671744	Josh Email User!

Possible Values:

type : typically ftp, sftp, shell, mail, or backup

Possible Errors:

(none)

user-remove_user
Removes a user specified by the username. Optionally the type of user or home can be specified to distinguish the user to delete (if the user exists on multiple homes/types). To specify the home, set the username to username@home. If the username has more than one type/home, you can set remove_all to remove all instances of the user (note: if remove_all is set and the type or home is specified, it will remove all instances of username with that type or on that home).

Values:

username : the user to remove, like testuser42. Optionally use username@home to specify a home, like testuser42@riga type : (Optional) the type of user, like ftp, shell, etc remove_all : (Optional) set to 1 to remove all instances of this user (if user has multiple types or is on multiple homes)

Result: success

Possible Errors: invalid_user (specific error after tab) multiple_user_services (specific error after tab, such as the user has more than one type/home and the type/home and remove_all were not set) cannot_remove_user (specific error after tab)