1 Linux Valid Usernames
tengel edited this page 2024-03-20 11:55:03 -05:00

POSIX Standard

Upstream Source

Debian Family

/*
 * POSIX indicate that usernames are composed of characters from the
 * portable filename character set [A-Za-z0-9._-], and that the hyphen
 * should not be used as the first character of a portable user name.
 *
 * Allow more relaxed user/group names in Debian -- ^[^-~+:,\s][^:,\s]*$
 */

RHEL Family

/*
 * User/group names must match gnu e-regex:
 *    [a-zA-Z0-9_.][a-zA-Z0-9_.-]{0,30}[a-zA-Z0-9_.$-]?
 *
 * as a non-POSIX, extension, allow "$" as the last char for
 * sake of Samba 3.x "add machine script"
 *
 * Also do not allow fully numeric names or just "." or "..".
 */

BSD Family

OpenBSD

FreeBSD

NetBSD