0

Receiving an error while creating a user with numbers. Can anyone guide me on how to create a user with numbers like an employee ID, for example 8811002.

I am receiving the below error:

useradd: invalid user name
Edward
  • 2,364
  • 3
  • 16
  • 26
  • 3
    It's not recommended, I suggest you use something like `x8811002` or any valid character at the beginning. Some answers [here](https://unix.stackexchange.com/questions/287077/why-cant-linux-usernames-begin-with-numbers) should be useful to know why you should not create users like that. – Edgar Magallon Nov 30 '22 at 08:16
  • What Linux are you working on? It would be easiest to achieve this by prefixing each name by a fix string, such as `id`. This is what some publicly accessible Unix shell hosts do, so the user with UID 1234 might have the name m1234 or similar. – Kusalananda Nov 30 '22 at 09:13
  • Does this answer your question? [Why can't Linux usernames begin with numbers?](https://unix.stackexchange.com/questions/287077/why-cant-linux-usernames-begin-with-numbers) – Nikita Kipriyanov Nov 30 '22 at 09:16

0 Answers0