View previous topic :: View next topic |
Author |
Message |
Messiah Tux's lil' helper
Joined: 30 Apr 2002 Posts: 139
|
Posted: Sun Jun 30, 2002 3:09 pm Post subject: A dot in a username and groupname |
|
|
Dear all,
I desparately need the ability to add a user with a dot in its username and its groupname, just like I could on Mandrake systems and other systems I have been using.
So how can I do this in Gentoo?
# useradd test.test
useradd: invalid user name 'test.test'
# groupadd test.test
groupadd: test.test is a not a valid group name
I tried adding the user manually in /etc/passwd, and the user in /etc/group, it seems to go ok, but then I can't change the password:
#passwd test.test
passwd: Authentication token manipulation error
Help! |
|
Back to top |
|
|
Naan Yaar Bodhisattva
Joined: 27 Jun 2002 Posts: 1549
|
Posted: Sun Jun 30, 2002 3:19 pm Post subject: Re: A dot in a username and groupname |
|
|
You need to add an entry to /etc/shadow to set the password. Something that looks like this:
test.test::10730:0:99999:7:::
Then use passwd to reset the password.
Messiah wrote: | Dear all,
I desparately need the ability to add a user with a dot in its username and its groupname, just like I could on Mandrake systems and other systems I have been using.
So how can I do this in Gentoo?
# useradd test.test
useradd: invalid user name 'test.test'
# groupadd test.test
groupadd: test.test is a not a valid group name
I tried adding the user manually in /etc/passwd, and the user in /etc/group, it seems to go ok, but then I can't change the password:
#passwd test.test
passwd: Authentication token manipulation error
Help! |
|
|
Back to top |
|
|
Messiah Tux's lil' helper
Joined: 30 Apr 2002 Posts: 139
|
Posted: Sun Jun 30, 2002 3:22 pm Post subject: |
|
|
I was about to edit my post to say that i forgot to add an entry in shadow. After that it worked.
This is a nice fallbak option.
But I want to do it via the command groupadd and useradd. Any ideas? I know I could write it myself, and I will if I cannot find another script that will handle this, but why reinvent the weel if it already is invented? |
|
Back to top |
|
|
handsomepete Guru
Joined: 21 Apr 2002 Posts: 548 Location: Kansas City, MO
|
Posted: Sun Jun 30, 2002 3:27 pm Post subject: |
|
|
Code: | # useradd 'test.test'
# passwd 'test.test'
Changing password for user test.test.
New password:
BAD PASSWORD: it's WAY too short
Retype new password:
passwd: all authentication tokens updated successfully.
# userdel 'test.test'
|
Single quotes! |
|
Back to top |
|
|
Naan Yaar Bodhisattva
Joined: 27 Jun 2002 Posts: 1549
|
Posted: Sun Jun 30, 2002 3:45 pm Post subject: |
|
|
In this case, using single quotes shouldn't really matter since the '.' is safe in terms of shell wildcarding anyway. Looks like we may be using different versions of useradd.
handsomepete wrote: | Code: | # useradd 'test.test'
# passwd 'test.test'
Changing password for user test.test.
New password:
BAD PASSWORD: it's WAY too short
Retype new password:
passwd: all authentication tokens updated successfully.
# userdel 'test.test'
|
Single quotes! |
|
|
Back to top |
|
|
Messiah Tux's lil' helper
Joined: 30 Apr 2002 Posts: 139
|
Posted: Sun Jun 30, 2002 4:07 pm Post subject: |
|
|
# useradd 'test.test'
useradd: invalid user name 'test.test'
and quotes shouldn't matter at all, i think handsomepete can add just test.test without single quotes. So why is handsomepete able to do this and I am not? |
|
Back to top |
|
|
handsomepete Guru
Joined: 21 Apr 2002 Posts: 548 Location: Kansas City, MO
|
Posted: Sun Jun 30, 2002 4:54 pm Post subject: |
|
|
Yeah, I suppose I could've tested without quotes... (periods are not spaces.. *sigh*). It worked for me because I'm at work and did that on a Red Hat box without thinking that it was a Gentoo specific issue . I can't imagine what would stop that from working... I can do it on everything here at work (Digital Unix 4.0, AIX 4, Red Hat Linux...). There's not an 8 char username limit in Gentoo, is there?
Just out of curiousity can you emerge superadduser and try it via that util? I know it's just a front end, but it might play differently... I have no idea. |
|
Back to top |
|
|
Messiah Tux's lil' helper
Joined: 30 Apr 2002 Posts: 139
|
Posted: Sun Jun 30, 2002 5:51 pm Post subject: |
|
|
superadduser doesn't work
there is no 8 character limit on usernames or groupnames in Gentoo
I will write a perl script that will work for me and will post it here |
|
Back to top |
|
|
Messiah Tux's lil' helper
Joined: 30 Apr 2002 Posts: 139
|
|
Back to top |
|
|
|