A student just asked what could be the downside of having a dot (
. ) in the name of the user. For example:
How will this affect the system or any apps for that matter?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
POSIX states this about usernames:
[...] To be portable across systems conforming to IEEE Std 1003.1-2001, the value is composed of characters from the portable filename character set. The hyphen should not be used as the first character of a portable user name.
... where the portable filename character set is:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 . _ -
Also, the manpage for the
/etc/adduser.conf file states:
VALID NAMES adduser and addgroup enforce conformity to IEEE Std 1003.1-2001, which allows only the following characters to appear in group and user names: letters, digits, underscores, periods, at signs (@) and dashes. The name may not start with a dash. The "$" sign is allowed at the end of usernames (to conform to samba). An additional check can be adjusted via the configuration parameter NAME_REGEX to enforce a local policy.
Whilst both specifications seem to include the dot, Ubuntu (on my 13.04 at least) seems to disallow it:
⊳ sudo adduser as.df adduser: Please enter a username matching the regular expression configured via the NAME_REGEX[_SYSTEM] configuration variable. Use the `--force-badname' option to relax this check or reconfigure NAME_REGEX.
NAME_REGEX in Ubuntu is (from the
in conclusion a dot
. may be used for a Ubuntu username, the
NAME_REGEX just has to be changed in
/etc/adduser.conf. Seeing as it conforms to POSIX, there shouldn't be any problems with having a
. in the username with any POSIX-compliant program.
Run this command in a terminal:
sudo nano /etc/adduser.conf
Locate this line (near the end of the file)
and replace it with
Note that the
- must remain the first character in the bracket expression
[...], otherwise it is treated as specifying a range
Press Ctrl+X, then Y, then Enter.
Marc Haber explains a possible downside in Debian bug #604242 (Allow dots in username by default):
Having dots in the user name creates some issues with scipts using
chown, which still accepts dots as separator between user name and group name. If
chownstill accepts dots, there will be scripts using this notation, which will break if a user name contains a dot.
I would recommend keeping the current default (which can be overwritten by local configuration) until
chownhas stopped accepting dots as separator.
chown still accepts the dot as separator, although it isn't documented anymore. I agree POSIX compatibility should prevail, and I indeed employ user names containing dots on several systems without any adverse effects.