LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 05-17-2012, 07:09 PM   #1
thund3rstruck
Member
 
Registered: Nov 2005
Location: East Coast, USA
Distribution: Fedora 18, Slackware64 13.37, Windows 7/8
Posts: 346

Rep: Reputation: 38
User name with a period


All the users on my home network use the convention [<givenName>.<surName>]; e.g. Bill.Baxter, Jill.Bonniville, etc

For whatever reason slackware rejects these names as illegal. I have been using this convention for over a decade and I've never seen this with any other version of Linux.

I know I can manually hack at the /etc/passwd file and then shadow the pass and all that but I really don't want to do that. Are these rules defined in a script I could modify and is there any intrinsic reason for this constraint (in other words will having ids like this damage the system in any way)?

I've got a mixture of Windows 2003/2008 and Linux servers along with an even mix of Windows XP/7 and Linux workstations and changing all our usernames on the servers is not really feasible.

Thanks!
 
Old 05-17-2012, 07:25 PM   #2
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.1
Posts: 1,322

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
What command is rejecting the user name?

If it's adduser, you can simply hack the script (since it's in bash).

Last edited by Richard Cranium; 05-17-2012 at 07:28 PM. Reason: Did more research.
 
Old 05-17-2012, 07:34 PM   #3
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 1,822

Rep: Reputation: Disabled
useradd rejects usernames with periods, unless your distribution happens to be using a patched version of useradd. I know Fedora accepts periods in usernames, and I would guess the same goes for RHEL and CentOS.

Having usernames with periods may break some scripts or tools, as the period is occasionally used as a separator. For instance, how should this command be interpreted: chown john.doe <filename>. Are you changing the owner to "john.doe", or "john" and the group "doe"?

Through a Google search, I stumbled upon a presentation which discusses this and related issues.
 
1 members found this post helpful.
Old 05-18-2012, 03:21 AM   #4
rouvas
Member
 
Registered: Aug 2006
Location: Greece
Distribution: Slackware.12.2
Posts: 72
Blog Entries: 2

Rep: Reputation: 4
Actually, the correct usage pattern for chown is "chown user:group item".
 
1 members found this post helpful.
Old 05-18-2012, 04:14 AM   #5
GazL
Senior Member
 
Registered: May 2008
Posts: 3,231

Rep: Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828
The reason being that they would have been invalid on a traditional UNIX system. Pity the convention in microsoft land wasn't to use an underscore as that would have worked on both platforms, but then as the choice of '\' v '/' path separator in DOS shows, they just had to be different for the sake of it.
 
Old 05-18-2012, 05:07 AM   #6
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 1,822

Rep: Reputation: Disabled
Quote:
Originally Posted by rouvas View Post
Actually, the correct usage pattern for chown is "chown user:group item".
That is the correct usage today, but "." is still accepted as a separator to retain legacy compatibility.

I believe the latest Unix standards document covering Unix/POSIX username convensions (IEEE Std 1003.1, 2004 Edition) allows periods, but until all legacy compatibility has been removed from tools and applications, having periods in usernames is likely to cause breakage.
 
Old 05-18-2012, 08:08 AM   #7
thund3rstruck
Member
 
Registered: Nov 2005
Location: East Coast, USA
Distribution: Fedora 18, Slackware64 13.37, Windows 7/8
Posts: 346

Original Poster
Rep: Reputation: 38
Quote:
Originally Posted by Richard Cranium View Post
What command is rejecting the user name?

If it's adduser, you can simply hack the script (since it's in bash).
No, we have always used:

Code:
useradd -m -s /bin/bash -G plugdev,audio,video,scanner,cdrom <givenName>.<surName>
Are you saying that there's a script called adduser that I can modify to allow periods? Will it work with the same syntax as the useradd command (e.g. in automated scripts)?

I'll investigate this.


Quote:
For instance, how should this command be interpreted: chown john.doe <filename>. Are you changing the owner to "john.doe", or "john" and the group "doe"?
Wow, I have always used chown john:Doe to assign this membership. I didn't even know using a period was an option.

Quote:
useradd rejects usernames with periods, unless your distribution happens to be using a patched version of useradd.
I have been using these user names for a decade and up until a few days ago in Slackware, I have never seen this before (and I've tried just about every distribution out there).
 
Old 05-18-2012, 08:26 AM   #8
stormtracknole
Member
 
Registered: Aug 2005
Location: The Big Easy
Distribution: Slackware, RHEL
Posts: 779

Rep: Reputation: 103Reputation: 103
Could this be because Slackware doesn't use PAM?
 
Old 05-18-2012, 08:41 AM   #9
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.1
Posts: 1,322

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
Quote:
Originally Posted by thund3rstruck View Post
No, we have always used:

Code:
useradd -m -s /bin/bash -G plugdev,audio,video,scanner,cdrom <givenName>.<surName>
Are you saying that there's a script called adduser that I can modify to allow periods? Will it work with the same syntax as the useradd command (e.g. in automated scripts)?
Well, adduser calls useradd under the covers. From what others have posted, it will do you no good to change the script since useradd will reject the name anyways.

adduser is interactive, so it isn't useful for automated scripts.
 
Old 05-18-2012, 08:41 AM   #10
dugan
Senior Member
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 4,245

Rep: Reputation: 1299Reputation: 1299Reputation: 1299Reputation: 1299Reputation: 1299Reputation: 1299Reputation: 1299Reputation: 1299Reputation: 1299
Quote:
Originally Posted by thund3rstruck View Post
[/code]Are you saying that there's a script called adduser that I can modify to allow periods?
I don't know about modifying it to allow periods, but adduser is the standard way of adding users to a Slackware installation.

http://www.slackbook.org/html/essent...SYSADMIN-USERS

Last edited by dugan; 05-18-2012 at 08:42 AM.
 
Old 05-18-2012, 08:54 AM   #11
thund3rstruck
Member
 
Registered: Nov 2005
Location: East Coast, USA
Distribution: Fedora 18, Slackware64 13.37, Windows 7/8
Posts: 346

Original Poster
Rep: Reputation: 38
Quote:
Originally Posted by dugan View Post
I don't know about modifying it to allow periods, but adduser is the standard way of adding users to a Slackware installation.

http://www.slackbook.org/html/essent...SYSADMIN-USERS
Ha, thanks. That's way too much work when useradd does the same thing with a single command.
 
Old 05-18-2012, 08:56 AM   #12
dugan
Senior Member
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 4,245

Rep: Reputation: 1299Reputation: 1299Reputation: 1299Reputation: 1299Reputation: 1299Reputation: 1299Reputation: 1299Reputation: 1299Reputation: 1299
It's adduser username. <ENTER>. <ENTER>. <UP>. <ENTER>. <ENTER>. ...

(The UP->ENTER is for the "which groups should the user belong to" step. UP to populate the list, ENTER to accept).

Fewer keystrokes than useradd if you're doing it interactively. But not suitable for use in scripts.

Last edited by dugan; 05-18-2012 at 09:03 AM.
 
Old 05-18-2012, 10:28 AM   #13
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 1,822

Rep: Reputation: Disabled
Quote:
Originally Posted by stormtracknole View Post
Could this be because Slackware doesn't use PAM?
My PAMified Slackware systems reject usernames with periods with with "User 'joe.schmoe' contains illegal charcters (period/dot); please choose another".

Nothing appears in /var/log/secure, which makes sense if PAM isn't actually called at this point.
 
Old 05-18-2012, 10:35 AM   #14
stormtracknole
Member
 
Registered: Aug 2005
Location: The Big Easy
Distribution: Slackware, RHEL
Posts: 779

Rep: Reputation: 103Reputation: 103
Quote:
Originally Posted by Ser Olmy View Post
My PAMified Slackware systems reject usernames with periods with with "User 'joe.schmoe' contains illegal charcters (period/dot); please choose another".

Nothing appears in /var/log/secure, which makes sense if PAM isn't actually called at this point.
Ah, good to know. Thanks for pointing that out.
 
  


Reply

Tags
slackware, username, users


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to incorporate Contention free period and contention period together in 802.11e? stud17 Linux - Newbie 0 01-20-2012 05:27 PM
How to Find : Inactive user for a defined period of time ? avklinux Linux - General 2 01-28-2009 11:37 AM
What does a single period ( . ) mean in bash? BobTheSlob Programming 10 08-18-2007 02:00 AM
Linux suxs period. MatchStick General 24 08-15-2005 04:01 PM
Cannot compile... period. element Linux - Software 6 03-27-2003 04:36 PM


All times are GMT -5. The time now is 05:44 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration