Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to know what the maximum username length is for current GNU/Linux systems, e.g. Ubuntu 11.04.

8 characters appears to be some historical standard, but I've already noticed on my current Ubuntu system that this limit does not apply.

share|improve this question
up vote 22 down vote accepted

The current limit is 32 characters (according to useradd man page).

share|improve this answer

The answer varies somewhat.

useradd(1) references a limit of 32 characters. This is based AFAIU on libc6.

Some utilities or systems may impose shorter names or behave inconsistently when presented with longer names, including top, ps, w/who, finger, NFS, and various multi-platform directory systems (NIS/NIS+, SMB, CIFS, Kerberos), potentially based on limitations of other/remote platforms. Many of the various psutil commands will display a UID rather than username if the latter exceeds 8 characters.

Some utilities and applications may impose their own arbitrary limitations. E.g.: IBM's DB2 apparently won't allow logins from users with usernames exceeding 8 characters:

8 characters is a generally sane limit, and saves typing.

share|improve this answer
Thank you for this answer. Just one note: If you use linux users for isolated computing environments, 8 characters is often too small. At least if you want the names to be readable. – guettli Mar 20 '14 at 12:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.