1847283 Members
2544 Online
110263 Solutions
New Discussion

Period in usernames

 
SOLVED
Go to solution
Ian Foster_2
Frequent Advisor

Period in usernames

What's the general feeling about putting periods in unix usernames ?

Our client is moving to a common desktop with active directory and the new windows domain users will be formatted as firstname.lastname - we have been asked if we can create any new unix users with the same naming convention.

I'm not sure about this and would value any thoughts/opinions here.
8 REPLIES 8
Alessandro Pilati
Esteemed Contributor

Re: Period in usernames

Ian,
you can create your users with the convention you wrote.

For example:

useradd -u 223 -g users ian.foster

Your default homedir will be /home/ian.foster

I think that you shouldn't have any problem...

Rgds,
Alex
if you don't try, you'll never know if you are able to
Jannik
Honored Contributor
Solution

Re: Period in usernames

thats fine it works ok. your only problem will be that useradd only support 8 characters you you can create the users by hand...
If you har using AD that should work as well.
jaton
Chris Wilshaw
Honored Contributor

Re: Period in usernames

According to the useradd man page, there shouldn't be an issue with this;

The useradd command may be used with the login argument, where login is the new login name, specified as a string of printable characters. It may not contain a colon (:) or a newline (\n).

I've just run a quick test on one of our dev systems here, and I can confirm that it's worked, and that the ID can successfully log in to the system.
Marlou Everson
Trusted Contributor

Re: Period in usernames

The pwck(1M) command will complain about a bad character in the login name. It doesn't prevent you from using them. We had a system with periods in the user names and I never had any problems with the logins.

Marlou
Mel Burslan
Honored Contributor

Re: Period in usernames

As one of the most clever personal quotes here on ITRC said (can't remember which one):

In theory, there is no difference between theory and practice. But, in practice, there is.

so, if you *CAN* do something does not necessarily mean you should do it. I personally, would try to convince the customer that, this may cause them some headache in the long run. As indicated in the previous post, complaints from app.s like pwck will be an issue. Although in pwck case, this is not a dealbreaker, in some unforeseen circumstances, it may put you in a bad situation. Something you can not predict from today, may start not working after a while, when you need it.

So, in short : proceed with caution ! Slippery road ahead...
________________________________
UNIX because I majored in cryptology...
Raj D.
Honored Contributor

Re: Period in usernames

Hi Ian ,

As posted in this thread , if u try
useradd -u 223 -g users ian.foster

you will get ,
" Login 'ian.foster' is invalid " error.

As it is exceeding 8 character length.


How ever this will work ,
# useradd -u 223 -g users ia.foster

Cheers ,
Raj.

" If u think u can , If u think u cannot , - You are always Right . "
John E.Ophious
Regular Advisor

Re: Period in usernames

Howdy Ian,

Periods? Love em. Gives the usernames special character. My favorite of course:

John.E.O

useradd -u 34234 -g cowboys John.E.O

Take care of youself bud,

John E. Ophious
Ian Foster_2
Frequent Advisor

Re: Period in usernames

Assessment is - can be done - but not necessarily 'recommended'. Erring on the side of caution.