java.lang.Object
com.aoindustries.aoserv.client.AoservObject<User.Name,User>
com.aoindustries.aoserv.client.CachedObject<User.Name,User>
com.aoindustries.aoserv.client.linux.CachedObjectUserNameKey<User>
com.aoindustries.aoserv.client.linux.User
- All Implemented Interfaces:
Streamable
,StreamReadable
,StreamWritable
,Row
,AoservReadable
,AoservStreamable
,AoservWritable
,Disablable
,PasswordProtected
,Removable
,SingleTableObject<User.Name,
User>
public final class User
extends CachedObjectUserNameKey<User>
implements PasswordProtected, Removable, Disablable
One user may have shell, FTP, and/or email access to any number
of servers. However, some of the information is common across
all machines, and that set of information is contained in a
LinuxAccount
.- Author:
- AO Industries, Inc.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Used for the various user-provided fields in the/etc/passwd
file.static class
Represents a Linux username. -
Field Summary
Modifier and TypeFieldDescriptionstatic final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Deprecated.User httpd no longer used.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final String
static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.static final User.Name
Some commonly used system and application account usernames.Fields inherited from class com.aoindustries.aoserv.client.linux.CachedObjectUserNameKey
pkey
Fields inherited from class com.aoindustries.aoserv.client.CachedObject
table
Fields inherited from class com.aoindustries.aoserv.client.AoservObject
USE_ARRAY_OF_DOMAIN, USE_SQL_DATA, USE_SQL_DATA_WRITE
Fields inherited from interface com.aoindustries.aoserv.client.password.PasswordProtected
ALL, NONE, SOME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addLinuxGroup
(Group group) int
addLinuxServerAccount
(Server aoServer, PosixPath home) int
boolean
boolean
boolean
static List
<PasswordChecker.Result> checkPassword
(User.Name username, String type, String password) Checks the strength of a password as required for thisLinuxAccount
.checkPassword
(String password) void
disable
(DisableLog dl) void
enable()
Lists the reasons an object may not be removed.protected Object
getColumnImpl
(int i) getLinuxServerAccount
(Server aoServer) getName()
getShell()
getType()
getValidHomeDirectories
(User.Name username, Server ao) void
Initializes this object from the raw database contents.boolean
Checks if this object is disabled.void
read
(StreamableInput in, AoservProtocol.Version protocolVersion) void
remove()
Removes this object, and all dependant objects, from the system.void
removeLinuxGroup
(Group group) void
setHomePhone
(User.Gecos phone) void
setName
(User.Gecos name) void
setOfficeLocation
(User.Gecos location) void
setOfficePhone
(User.Gecos phone) void
setPassword
(String password) void
setPrimaryLinuxGroup
(Group group) void
void
write
(StreamableOutput out, AoservProtocol.Version protocolVersion) Methods inherited from class com.aoindustries.aoserv.client.linux.CachedObjectUserNameKey
equals, getKey, hashCode, toStringImpl
Methods inherited from class com.aoindustries.aoserv.client.CachedObject
getTable, setTable
Methods inherited from class com.aoindustries.aoserv.client.AoservObject
compare, compare, compare, compare, compareIgnoreCaseConsistentWithEquals, compareTo, compareTo, compareTo, getAccountingCode, getColumn, getColumns, getColumns, getDomainLabel, getDomainLabels, getDomainName, getDto, getEmail, getGecos, getGroupId, getHashedKey, getHashedPassword, getHostname, getInetAddress, getLinuxId, getLinuxUserName, getMacAddress, getMysqlDatabaseName, getMysqlServerName, getMysqlUserName, getPort, getPostgresDatabaseName, getPostgresServerName, getPostgresUserId, getTableSchema, getTimeMillis, getTimeMillis, getUnixPath, getUserId, read, toString, write
-
Field Details
-
ADM
Some commonly used system and application account usernames. -
AOADMIN
Some commonly used system and application account usernames. -
AOSERV_JILTER
Some commonly used system and application account usernames. -
AOSERV_XEN_MIGRATION
Some commonly used system and application account usernames. -
APACHE
Some commonly used system and application account usernames. -
AVAHI_AUTOIPD
Some commonly used system and application account usernames. -
AWSTATS
Some commonly used system and application account usernames. -
BIN
Some commonly used system and application account usernames. -
BIRD
Some commonly used system and application account usernames. -
CHRONY
Some commonly used system and application account usernames. -
CLAMSCAN
Some commonly used system and application account usernames. -
CLAMUPDATE
Some commonly used system and application account usernames. -
CYRUS
Some commonly used system and application account usernames. -
DAEMON
Some commonly used system and application account usernames. -
DBUS
Some commonly used system and application account usernames. -
DHCPD
Some commonly used system and application account usernames. -
EMAILMON
Some commonly used system and application account usernames. -
FTP
Some commonly used system and application account usernames. -
FTPMON
Some commonly used system and application account usernames. -
GAMES
Some commonly used system and application account usernames. -
HALT
Some commonly used system and application account usernames. -
INTERBASE
Some commonly used system and application account usernames. -
LP
Some commonly used system and application account usernames. -
MAIL
Some commonly used system and application account usernames. -
MAILNULL
Some commonly used system and application account usernames. -
MEMCACHED
Some commonly used system and application account usernames. -
MYSQL
Some commonly used system and application account usernames. -
NAMED
Some commonly used system and application account usernames. -
NFSNOBODY
Some commonly used system and application account usernames. -
NGINX
Some commonly used system and application account usernames. -
NOBODY
Some commonly used system and application account usernames. -
OPERATOR
Some commonly used system and application account usernames. -
POLKITD
Some commonly used system and application account usernames. -
POSTGRES
Some commonly used system and application account usernames. -
REDIS
Some commonly used system and application account usernames. -
ROOT
Some commonly used system and application account usernames. -
RPC
Some commonly used system and application account usernames. -
RPCUSER
Some commonly used system and application account usernames. -
SASLAUTH
Some commonly used system and application account usernames. -
SHUTDOWN
Some commonly used system and application account usernames. -
SMMSP
Some commonly used system and application account usernames. -
SSHD
Some commonly used system and application account usernames. -
SYNC
Some commonly used system and application account usernames. -
SYSTEMD_BUS_PROXY
Some commonly used system and application account usernames. -
SYSTEMD_NETWORK
Some commonly used system and application account usernames. -
TCPDUMP
Some commonly used system and application account usernames. -
TSS
Some commonly used system and application account usernames. -
UNBOUND
Some commonly used system and application account usernames. -
AOSERV_MASTER
Some commonly used system and application account usernames. -
ACCOUNTING
Some commonly used system and application account usernames. -
BILLING
Some commonly used system and application account usernames. -
DISTRIBUTION
Some commonly used system and application account usernames. -
INFRASTRUCTURE
Some commonly used system and application account usernames. -
MANAGEMENT
Some commonly used system and application account usernames. -
MONITORING
Some commonly used system and application account usernames. -
RESELLER
Some commonly used system and application account usernames. -
CENTOS
Some commonly used system and application account usernames. -
JENKINS
Some commonly used system and application account usernames. -
OPROFILE
Some commonly used system and application account usernames. -
SONARQUBE
Some commonly used system and application account usernames. -
FLATPAK
Some commonly used system and application account usernames. -
GEOCLUE
Some commonly used system and application account usernames. -
PIPEWIRE
Some commonly used system and application account usernames. -
RTKIT
Some commonly used system and application account usernames. -
SSSD
Some commonly used system and application account usernames. -
SYSTEMD_COREDUMP
Some commonly used system and application account usernames. -
SYSTEMD_OOM
Some commonly used system and application account usernames. -
HTTPD
Deprecated.User httpd no longer used. -
NO_PASSWORD_CONFIG_VALUE
- See Also:
-
-
Constructor Details
-
User
Deprecated.Only required for implementation, do not use directly.- See Also:
-
-
Method Details
-
addFtpGuestUser
- Throws:
IOException
SQLException
-
addLinuxGroup
- Throws:
IOException
SQLException
-
addLinuxServerAccount
- Throws:
IOException
SQLException
-
arePasswordsSet
- Specified by:
arePasswordsSet
in interfacePasswordProtected
- Throws:
IOException
SQLException
-
canDisable
- Specified by:
canDisable
in interfaceDisablable
- Throws:
IOException
SQLException
-
canEnable
- Specified by:
canEnable
in interfaceDisablable
- Throws:
SQLException
IOException
-
checkPassword
- Specified by:
checkPassword
in interfacePasswordProtected
- Throws:
IOException
-
checkPassword
public static List<PasswordChecker.Result> checkPassword(User.Name username, String type, String password) throws IOException Checks the strength of a password as required for thisLinuxAccount
. The strength requirement depends on theLinuxAccountType
.- Throws:
IOException
- See Also:
-
disable
- Specified by:
disable
in interfaceDisablable
- Throws:
IOException
SQLException
-
enable
- Specified by:
enable
in interfaceDisablable
- Throws:
IOException
SQLException
-
getColumnImpl
- Specified by:
getColumnImpl
in classAoservObject<User.Name,
User>
-
getCreated
-
isDisabled
public boolean isDisabled()Description copied from interface:Disablable
Checks if this object is disabled. This should execute very quickly (not incur any round-trip to any database) and thus does not throw any checked exceptions.- Specified by:
isDisabled
in interfaceDisablable
-
getDisableLog
- Specified by:
getDisableLog
in interfaceDisablable
- Throws:
SQLException
IOException
-
getFtpGuestUser
- Throws:
IOException
SQLException
-
getHomePhone
-
getLinuxGroups
- Throws:
IOException
SQLException
-
getLinuxServerAccount
- Throws:
IOException
SQLException
-
getLinuxServerAccounts
- Throws:
IOException
SQLException
-
getName
-
getOfficeLocation
-
getOfficePhone
-
getPrimaryGroup
- Throws:
IOException
SQLException
-
getShell
- Throws:
SQLException
IOException
-
getTableId
- Specified by:
getTableId
in classAoservObject<User.Name,
User>
-
getType
- Throws:
IOException
SQLException
-
getUsername_id
-
getUsername
- Throws:
SQLException
IOException
-
getValidHomeDirectories
- Throws:
SQLException
IOException
-
getValidHomeDirectories
public static List<PosixPath> getValidHomeDirectories(User.Name username, Server ao) throws SQLException, IOException - Throws:
SQLException
IOException
-
init
Description copied from class:AoservObject
Initializes this object from the raw database contents.- Specified by:
init
in classAoservObject<User.Name,
User> - Parameters:
result
- theResultSet
containing the row to copy into this object- Throws:
SQLException
-
read
- Specified by:
read
in interfaceAoservReadable
- Specified by:
read
in interfaceAoservStreamable
- Specified by:
read
in classAoservObject<User.Name,
User> - Throws:
IOException
-
getCannotRemoveReasons
Description copied from interface:Removable
Lists the reasons an object may not be removed.- Specified by:
getCannotRemoveReasons
in interfaceRemovable
- Returns:
- an empty
List<CannotRemoveReason>
if this object may be removed, or a list of descriptions - Throws:
SQLException
IOException
-
remove
Description copied from interface:Removable
Removes this object, and all dependant objects, from the system.- Specified by:
remove
in interfaceRemovable
- Throws:
IOException
SQLException
-
removeLinuxGroup
- Throws:
IOException
SQLException
-
setHomePhone
- Throws:
IOException
SQLException
-
setName
- Throws:
IOException
SQLException
-
setOfficeLocation
- Throws:
IOException
SQLException
-
setOfficePhone
- Throws:
IOException
SQLException
-
setPassword
- Specified by:
setPassword
in interfacePasswordProtected
- Throws:
SQLException
IOException
-
setShell
- Throws:
IOException
SQLException
-
write
- Specified by:
write
in interfaceAoservStreamable
- Specified by:
write
in interfaceAoservWritable
- Specified by:
write
in classAoservObject<User.Name,
User> - Throws:
IOException
-
canSetPassword
- Specified by:
canSetPassword
in interfacePasswordProtected
- Throws:
IOException
SQLException
-
setPrimaryLinuxGroup
- Throws:
SQLException
IOException
-