LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 04-09-2008, 08:58 AM   #1
Exeunt
LQ Newbie
 
Registered: Feb 2007
Location: Horsham, PA
Distribution: Slackware 12.2, 14, Current
Posts: 18

Rep: Reputation: 1
Problem re-creating user with adduser


Hi All,

Using Slack 11.

I deleted a user with userdel and then tried to re-create
the account with the same username using adduser.

It told me "the user already exists".

I did a grep in /etc for the username and removed it from
group-, passwd-, shadow-, etc, manually. I even re-booted.

It still fails the same way. Am I missing something?

Exeunt
 
Old 04-09-2008, 10:16 AM   #2
kummiliim
Member
 
Registered: Mar 2007
Location: Tallinn, Estonia
Distribution: Slackware 12.0
Posts: 276

Rep: Reputation: 30
Did you also remove the users from the files without dashes: group, passwd, shadow?

I've never understood what the point of those dashed files is. Anyway, afaik, adduser only checks the three dashless files.
 
Old 04-09-2008, 11:35 AM   #3
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
It may be failing because/if the former users' $HOME directory still exists.
 
Old 04-09-2008, 11:51 AM   #4
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
No it will not fail if the homedirectory exists. The 'adduser' command will complain with "- User 'username' already exists; please choose another" only if it is already present in /etc/passwd .
If you want the exact user account back, please check the user-id number of the account you deleted (ls -la /home will show you the numerical uidNumber when the account has been deleted) and when 'adduser' asks for "User ID ('UID') [ defaults to next available ]:" enter the number that you see being used for the deleted user in /home . IF you fail to do so, the new account gets another number and will not be able to work with the files in the old homedirectory.

Eric
 
Old 04-15-2008, 07:37 AM   #5
Exeunt
LQ Newbie
 
Registered: Feb 2007
Location: Horsham, PA
Distribution: Slackware 12.2, 14, Current
Posts: 18

Original Poster
Rep: Reputation: 1
Problem found

Everybody,

Thanks for all your suggestions. I found the problem
and it was pretty simple.

I had ypbind running and I had log-ins on Sun workstations
on the network with the same user name.

So I just disabled ypbind, pulled the Ethernet cable to be
really sure, rebooted, and had no problem recreating the
account.

The clue was I looked at the useradd code, found that it
called "getpwnam()", and wrote a small C program to call
this function.

When I saw it find a password for me it was obvious it
came from the network.

Simple, and pretty stupid of me.

Thanks again,

Exeunt
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with creating user account.. apexofhorizon Linux - General 1 07-26-2007 05:47 AM
problem in creating NEW USER in SUSE 9.1 Pravab SUSE / openSUSE 6 01-30-2007 08:34 AM
Problem creating new user Alexo Linux - Newbie 6 06-04-2005 04:31 PM
problem in creating new user ako Linux - Newbie 2 04-22-2004 02:57 AM
How can I define permissions on a /home/user dir _before_ creating it with adduser skunkburner Linux - General 6 03-18-2004 03:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:36 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration