Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
A dot in a username and groupname
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Duplicate Threads
View previous topic :: View next topic  
Author Message
Messiah
Tux's lil' helper
Tux's lil' helper


Joined: 30 Apr 2002
Posts: 139

PostPosted: Sun Jun 30, 2002 3:09 pm    Post subject: A dot in a username and groupname Reply with quote

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
View user's profile Send private message
Naan Yaar
Bodhisattva
Bodhisattva


Joined: 27 Jun 2002
Posts: 1549

PostPosted: Sun Jun 30, 2002 3:19 pm    Post subject: Re: A dot in a username and groupname Reply with quote

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
View user's profile Send private message
Messiah
Tux's lil' helper
Tux's lil' helper


Joined: 30 Apr 2002
Posts: 139

PostPosted: Sun Jun 30, 2002 3:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
handsomepete
Guru
Guru


Joined: 21 Apr 2002
Posts: 548
Location: Kansas City, MO

PostPosted: Sun Jun 30, 2002 3:27 pm    Post subject: Reply with quote

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
View user's profile Send private message
Naan Yaar
Bodhisattva
Bodhisattva


Joined: 27 Jun 2002
Posts: 1549

PostPosted: Sun Jun 30, 2002 3:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
Messiah
Tux's lil' helper
Tux's lil' helper


Joined: 30 Apr 2002
Posts: 139

PostPosted: Sun Jun 30, 2002 4:07 pm    Post subject: Reply with quote

# 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
View user's profile Send private message
handsomepete
Guru
Guru


Joined: 21 Apr 2002
Posts: 548
Location: Kansas City, MO

PostPosted: Sun Jun 30, 2002 4:54 pm    Post subject: Reply with quote

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 :oops:. 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
View user's profile Send private message
Messiah
Tux's lil' helper
Tux's lil' helper


Joined: 30 Apr 2002
Posts: 139

PostPosted: Sun Jun 30, 2002 5:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
Messiah
Tux's lil' helper
Tux's lil' helper


Joined: 30 Apr 2002
Posts: 139

PostPosted: Mon Jul 01, 2002 12:04 am    Post subject: Reply with quote

Well..I wrote my own script to handle this.

See this link:
https://forums.gentoo.org/viewtopic.php?t=6638
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Duplicate Threads All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum