Using all numeric for username

Hello,

We have a Solaris 9 machine and recently our client want to create username based on staff numbers (all numeric).

Is there any limitation in Solaris regarding creating username with numeric values (eg: 13598029)?

Thanks & Regards

Aryawarman Mahzar

There will be some problems with this. Consider:

chown $user somefile

The chown looks at the first argument. If $user is non-numeric like, say, "fred", chown will look up the numeric uid and use that. But if the first argument is something like "13598029", no look-up occurs. Chown simply uses 13598029 as the numeric uid. The passwd file man page says:

If you don't follow these instructions, expect to have problems. I don't know how many problems to expect because I have never tried it. But the use of the word "should" rather than "must" is an indication that it's possible. If you go ahead with this, please keep a list of the problems that ensue and post it here. Then we'll have a more complete answer ready for the next person who wants to try this.

Our company assigns usernames based on staff ID numbers, but prepends a u for "user" or c for "contractor" depending on your status. So employee 12345 is u12345 and contractor 67890 is c67890. Easy, predictable, and avoids the problems perderabo was talking about in his posts. Maybe you could try something like that instead.

Thank you all for replying...

Unfortunately the clien staff numbers is already 8 digit long, so I can't add more character in front of it :frowning:

I'm still looking for a way to overcome this problem other than saying to the customer that it can't be done :), based on little testing, the username with all numeric have problems when the user tries to connect to CDE GUI, an error message appeared in /var/adm/messages:

Jun 13 16:23:37 uajkt1 /usr/dt/bin/ttsession[27496]: [ID 848021 daemon.error] _Tt_iceauth::make_auth_cookie(): timeout in locking authority file '/home/13598029/.TTauthority'

It seems that DT unable to create .TTauthority in the user's home directory :confused:

You might try making the user name the same as the uid. So user named "13598029" would just happen to have a uid of 13598029. Then when software mistakes one for the other... it's still right.

No guarantees though....just a random thought...

I have seen long user names in use on Solaris. Creates problems too, but a different set of problems. I'm not sure what happens if the first 8 characters are not unique. But provided that you are using a local /etc/passwd file, It probably would mostly work.