Table of Contents
Table of Contents
The AccountsService provides a D-Bus API for programs to obtain information about user accounts that are present on a system.
Please see the other sections of this manual for an introduction to these concepts.
This API is not yet stable and is likely to change in the future.
Table of Contents
org.freedesktop.Accounts — Accounts interface
ListCachedUsers (out 'ao' users) FindUserById (in 'x' id, out 'o' user) FindUserByName (in 's' name, out 'o' user) CreateUser (in 's' name, in 's' fullname, out 'o' user, in 'i' accountType) CacheUser (in 's' name, out 'o' user) UncacheUser (in 's' name) DeleteUser (in 'x' id, in 'b' removeFiles) GetUsersLanguages (out 'as' languages)
Objects implementing org.freedesktop.Accounts also implements org.freedesktop.DBus.Introspectable, org.freedesktop.DBus.Properties
'DaemonVersion' read 's' 'HasNoUsers' read 'b' 'HasMultipleUsers' read 'b' 'AutomaticLoginUsers' read 'ao'
ListCachedUsers (out 'ao' users)
Lists users which have logged into the system locally before.
This is not meant to return an exhaustive list of all users.
It is possible for FindUserByName()
to return a user that's not on the list.
users
:Object paths of cached users
FindUserById (in 'x' id, out 'o' user)
Finds a user by uid.
id
:The uid to look up
user
:Object path of user
org.freedesktop.Accounts.Error.Failed
:FindUserByName (in 's' name, out 'o' user)
Finds a user by its username.
name
:The username to look up
user
:Object path of user
org.freedesktop.Accounts.Error.Failed
:CreateUser (in 's' name, in 's' fullname, out 'o' user, in 'i' accountType)
Creates a new user account.
The accountType argument can take the following values:
0: Standard user
1: Administrator
name
:The username for the new user
fullname
:The real name for the new user
user
:Object path of the new user
accountType
:The account type, encoded as an integer
org.freedesktop.Accounts.Error.PermissionDenied
:org.freedesktop.Accounts.Error.Failed
:CacheUser (in 's' name, out 'o' user)
Caches a user account, so that it shows up in ListCachedUsers() output. The user name may be a remote user, but the system must be able to lookup the user name and resolve the user information.
name
:The username for the user
user
:Object path of user
org.freedesktop.Accounts.Error.PermissionDenied
:org.freedesktop.Accounts.Error.UserDoesNotExist
:UncacheUser (in 's' name)
Releases all metadata about a user account, including icon, language and session. If the user account is from a remote server and the user has never logged in before, then that account will no longer show up in ListCachedUsers() output.
name
:The username for the user
org.freedesktop.Accounts.Error.PermissionDenied
:org.freedesktop.Accounts.Error.UserDoesNotExist
:DeleteUser (in 'x' id, in 'b' removeFiles)
Deletes a user account.
id
:The uid to delete
removeFiles
:Whether to remove the users files
org.freedesktop.Accounts.Error.PermissionDenied
:org.freedesktop.Accounts.Error.Failed
:GetUsersLanguages (out 'as' languages)
Lists all the languages set by all the users, sorted in order from most used to least used, in XPG locale format.
Note that the languages are not parsed, and functional duplicates can occur (for instance, en_GB and en_GB.UTF-8 may both end up in the list, even though they are the same).
The expectation is that package installers will use this to know which languages users are interested in, so as to install extra data, like translations, dictionaries, etc. system-wide.
languages
:List users' preferred languages, as an array of locale specification like "de_DE.UTF-8".
org.freedesktop.Accounts.User — User interface
SetUserName (in 's' name) SetRealName (in 's' name) SetEmail (in 's' email) SetLanguage (in 's' language) SetLanguages (in 'as' languages) SetXSession (in 's' x_session) SetSession (in 's' session) SetSessionType (in 's' session_type) SetLocation (in 's' location) SetHomeDirectory (in 's' homedir) SetShell (in 's' shell) SetIconFile (in 's' filename) SetLocked (in 'b' locked) SetAccountType (in 'i' accountType) SetPasswordMode (in 'i' mode) SetPassword (in 's' password, in 's' hint) SetPasswordHint (in 's' hint) SetAutomaticLogin (in 'b' enabled) GetPasswordExpirationPolicy (out 'x' expiration_time, out 'x' last_change_time, out 'x' min_days_between_changes, out 'x' max_days_between_changes, out 'x' days_to_warn, out 'x' days_after_expiration_until_lock) SetPasswordExpirationPolicy (in 'x' min_days_between_changes, in 'x' max_days_between_changes, in 'x' days_to_warn, in 'x' days_after_expiration_until_lock) SetUserExpirationPolicy (in 'x' expiration_time)
Objects implementing org.freedesktop.Accounts.User also implements org.freedesktop.DBus.Introspectable, org.freedesktop.DBus.Properties
'Uid' read 't' 'UserName' read 's' 'RealName' read 's' 'AccountType' read 'i' 'HomeDirectory' read 's' 'Shell' read 's' 'Email' read 's' 'Language' read 's' 'Languages' read 'as' 'Session' read 's' 'SessionType' read 's' 'XSession' read 's' 'Location' read 's' 'LoginFrequency' read 't' 'LoginTime' read 'x' 'LoginHistory' read 'a(xxa{sv})' 'IconFile' read 's' 'Saved' read 'b' 'Locked' read 'b' 'PasswordMode' read 'i' 'PasswordHint' read 's' 'AutomaticLogin' read 'b' 'SystemAccount' read 'b' 'LocalAccount' read 'b'
SetUserName (in 's' name)
Sets the userʼs username. Note that it is usually not allowed to have multiple users with the same username.
name
:The new username.
org.freedesktop.Accounts.Error.PermissionDenied
:org.freedesktop.Accounts.Error.Failed
:org.freedesktop.accounts.user-administration: To change the username of any user
SetRealName (in 's' name)
Sets the userʼs real name.
name
:The new name, typically in the form "Firstname Lastname".
org.freedesktop.Accounts.Error.PermissionDenied
:org.freedesktop.Accounts.Error.Failed
:org.freedesktop.accounts.change-own-user-data: To change their own name
org.freedesktop.accounts.user-administration: To change the name of another user
SetEmail (in 's' email)
Sets the userʼs email address.
Note that setting an email address in the AccountsService is not the same as configuring a mail client. Mail clients might default to email address that is configured here, though.
email
:The new email address.
org.freedesktop.Accounts.Error.PermissionDenied
:org.freedesktop.Accounts.Error.Failed
:org.freedesktop.accounts.change-own-user-data: To change their own email address
org.freedesktop.accounts.user-administration: To change the email address of another user
SetLanguage (in 's' language)
Sets the user's language.
The expectation is that display managers will start the userʼs session with this locale.
language
:The new language, as a locale specification like "de_DE.UTF-8".
org.freedesktop.Accounts.Error.PermissionDenied
:org.freedesktop.Accounts.Error.Failed
:org.freedesktop.accounts.change-own-user-data: To change their own language
org.freedesktop.accounts.user-administration: To change the language of another user
SetLanguages (in 'as' languages)
Sets the userʼs preferred languages. The first item in the list will be used to set the Language property.
The expectation is that package installers will use this to know which languages the user is interested in, so as to install extra data, like translations, dictionaries, etc.
languages
:The user's preferred languages, as an array of locale specification like "de_DE.UTF-8".
org.freedesktop.Accounts.Error.PermissionDenied
:org.freedesktop.Accounts.Error.Failed
:org.freedesktop.accounts.change-own-user-data: To change their own preferred languages
org.freedesktop.accounts.user-administration: To change the preferred languages of another user
SetXSession (in 's' x_session)
Sets the userʼs x session.
The expectation is that display managers will log the user in to this specified session, if available. Note this call is deprecated and has been superceded by SetSession since not all graphical sessions use X as the display server.
x_session
:The new xsession to start (e.g. "gnome")
org.freedesktop.Accounts.Error.PermissionDenied
:org.freedesktop.Accounts.Error.Failed
:org.freedesktop.accounts.change-own-user-data: To change their own language
org.freedesktop.accounts.user-administration: To change the language of another user
SetSession (in 's' session)
Sets the userʼs wayland or x session.
The expectation is that display managers will log the user in to this specified session, if available.
session
:The new session to start (e.g. "gnome-xorg")
org.freedesktop.Accounts.Error.PermissionDenied
:org.freedesktop.Accounts.Error.Failed
:org.freedesktop.accounts.change-own-user-data: To change their own language
org.freedesktop.accounts.user-administration: To change the language of another user
SetSessionType (in 's' session_type)
Sets the session type of the userʼs session.
Display managers may use this property to decide what type of display server to use when loading the session
session_type
:The type of the new session to start (e.g. "wayland" or "x11")
org.freedesktop.Accounts.Error.PermissionDenied
:org.freedesktop.Accounts.Error.Failed
:org.freedesktop.accounts.change-own-user-data: To change their own language
org.freedesktop.accounts.user-administration: To change the language of another user
SetLocation (in 's' location)
Sets the userʼs location.
location
:The new location as a freeform string.
org.freedesktop.Accounts.Error.PermissionDenied
:org.freedesktop.Accounts.Error.Failed
:org.freedesktop.accounts.change-own-user-data: To change their own location
org.freedesktop.accounts.user-administration: To change the location of another user
SetHomeDirectory (in 's' homedir)
Sets the userʼs home directory.
Note that changing the userʼs home directory moves all the content from the old location to the new one, and is potentially an expensive operation.
homedir
:The new homedir as an absolute path.
org.freedesktop.Accounts.Error.PermissionDenied
:org.freedesktop.Accounts.Error.Failed
:org.freedesktop.accounts.user-administration: To change the home directory of a user
SetShell (in 's' shell)
Sets the userʼs shell.
Note that setting the shell to a non-allowed program may prevent the user from logging in.
shell
:The new user shell.
org.freedesktop.Accounts.Error.PermissionDenied
:org.freedesktop.Accounts.Error.Failed
:org.freedesktop.accounts.user-administration: To change the shell of a user
SetIconFile (in 's' filename)
Sets the userʼs icon.
filename
:The absolute filename of a png file to use as the userʼs icon.
org.freedesktop.Accounts.Error.PermissionDenied
:org.freedesktop.Accounts.Error.Failed
:org.freedesktop.accounts.change-own-user-data: To change their own icon
org.freedesktop.accounts.user-administration: To change the icon of another user
SetLocked (in 'b' locked)
Locks or unlocks a userʼs account.
Locking an account prevents the user from logging in.
locked
:Whether to lock or unlock the userʼs account.
org.freedesktop.Accounts.Error.PermissionDenied
:org.freedesktop.Accounts.Error.Failed
:org.freedesktop.accounts.user-administration: To lock or unlock user accounts
SetAccountType (in 'i' accountType)
Changes the userʼs account type.
accountType
:The new account type, encoded as an integer:
0: Standard user
1: Administrator
org.freedesktop.Accounts.Error.PermissionDenied
:org.freedesktop.Accounts.Error.Failed
:org.freedesktop.accounts.user-administration: To change an account type
SetPasswordMode (in 'i' mode)
Changes the userʼs password mode.
Note that changing the password mode has the side-effect of unlocking the account.
mode
:The new password mode, encoded as an integer:
0: Regular password
1: Password must be set at next login
2: No password
org.freedesktop.Accounts.Error.PermissionDenied
:org.freedesktop.Accounts.Error.Failed
:org.freedesktop.accounts.user-administration: To change a userʼs password mode
SetPassword (in 's' password, in 's' hint)
Sets a new password for this user.
Note that setting a password has the side-effect of unlocking the account.
password
:The crypted password.
hint
:The password hint.
org.freedesktop.Accounts.Error.PermissionDenied
:org.freedesktop.Accounts.Error.Failed
:org.freedesktop.accounts.user-administration: To change the password of a user
SetPasswordHint (in 's' hint)
Sets the userʼs password hint.
hint
:The password hint.
org.freedesktop.Accounts.Error.PermissionDenied
:org.freedesktop.Accounts.Error.Failed
:org.freedesktop.accounts.change-own-user-data: To change their own language
org.freedesktop.accounts.user-administration: To change the language of another user
SetAutomaticLogin (in 'b' enabled)
Enables or disables automatic login for a user.
Note that usually only one user can have automatic login enabled, so turning it on for a user will disable it for the previously configured autologin user.
enabled
:Whether to enable automatic login for this user.
org.freedesktop.Accounts.Error.PermissionDenied
:org.freedesktop.Accounts.Error.Failed
:org.freedesktop.accounts.set-login-option: To change the login screen configuration
GetPasswordExpirationPolicy (out 'x' expiration_time, out 'x' last_change_time, out 'x' min_days_between_changes, out 'x' max_days_between_changes, out 'x' days_to_warn, out 'x' days_after_expiration_until_lock)
expiration_time
:last_change_time
:min_days_between_changes
:max_days_between_changes
:days_to_warn
:days_after_expiration_until_lock
:'AccountType' read 'i'
The userʼs account type, encoded as an integer:
0: Standard user
1: Administrator
'Language' read 's'
The user's main language, as a locale specification like "de_DE.UTF-8".
'Languages' read 'as'
The user's other preferred languages, as a locale specification like "de_DE.UTF-8".
'SessionType' read 's'
The type of session the user should use (e.g. "wayland" or "x11")
'LoginHistory' read 'a(xxa{sv})'
The login history for this user. Each entry in the array represents a login session. The first two members are the login time and logout time, as timestamps (seconds since the epoch). If the session is still running, the logout time is 0.
The a{sv} member is a dictionary containing additional information about the session. Possible members include 'type' (with values like ':0', 'tty0', 'pts/0' etc).
'PasswordMode' read 'i'
The password mode for the user account, encoded as an integer:
0: Regular password
1: Password must be set at next login
2: No password
'AutomaticLogin' read 'b'
Whether automatic login is enabled for the user.