QA: Can I allow usernames to just contain characters?

Question

Can I allow usernames to just contain characters?

Answer

This is no good idea in general, as numbers are commonly used for (U)IDs and similar, numeric values. This could lead to various, unknown and potential unfix-able issues. To give some simple example of that behavior:

If your username contains letters, you can use chmod to modify the UID to adjust permissions, set permissions before accounts are created, etc. The integer is considered the UID here:

root@ucs-9658:/tmp# id fabian.schneider
uid=212553(fabian.schneider)
root@ucs-9658:/tmp# chown 212553 test
root@ucs-9658:/tmp# ls -ahl test 
-rw-r--r-- 1 fabian.schneider root 0 Mar 13 11:57 test

Now create another account using the UID as the username and repeat the process:

root@ucs-9658:/tmp# useradd 212553
root@ucs-9658:/tmp# chown 212553 test
root@ucs-9658:/tmp# ls -ahl test  
-rw-r--r-- 1 212553 root 0 Mar 13 11:57 test

This topic was automatically closed after 24 hours. New replies are no longer allowed.