LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-06-2009, 02:13 AM   #16
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,036

Rep: Reputation: 96

Quote:
Originally Posted by veerloh View Post
Also the users which i delete and recreate again with the same name leads me to a failure. it says skel dir cannot write into the home directory of that user.

So i tried to delete the home directory for that user but could not. its not an empty directory. SO tried rm -rf to all files in that particaular dir which worked but two directories are still remaining.Which are
.
..

How should i do it?
The . and .. are special entries . means this folder and .. means my parent folder you do not delete them as they are referential in nature.

If you have removed the user veer and user veer's home directory used to be /home/veer
Code:
cd /home
rmdir veer
If /home/veer is not empty, and you get an error, then:
Code:
cd /home
rm -rf veer
When recreating users, if their home directory still exists, the most important part is to know what their user_id and group_id are so that you can recreate them with access to their files.
 
Old 05-06-2009, 02:28 AM   #17
veerloh
LQ Newbie
 
Registered: May 2009
Posts: 13

Original Poster
Rep: Reputation: 0
Okay..

will let you after work. Thanks
 
Old 05-06-2009, 11:21 PM   #18
veerloh
LQ Newbie
 
Registered: May 2009
Posts: 13

Original Poster
Rep: Reputation: 0
I tried rm -rf to remove the user directories and it did work. And fortunately i was able to change the user VeeR passwd too right away, i dont know how but it actually recognized user VeeR on its own.

I would like to know what are the significances of the different fields when i type the command grep '^root:' /etc/password and grep '^root:' /etc/shadow. like the 1st field is password encrypted i guess dont know the other. Also, do these fields remain the same when i check this command for any other user eg: grep '^VeeR:' /etc/shadow.

Thank you for replying. you have really helped me out of this.

Regards,
 
Old 05-07-2009, 01:24 AM   #19
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
For /etc/passwd
Code:
chris:x:500:500:chris:/home/chris:/bin/bash
Fields are:

1. login/username
2. encrypted passwd; here 'x' means passwd is not here but in /etc/shadow
3. numeric uid (user id)
4. numeric gid (group id)
5. real name
6. home dir
7. login shell

for /etc/shadow, see
man shadow
 
Old 05-07-2009, 01:50 AM   #20
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,036

Rep: Reputation: 96
Chris,

I always thought field 5 was for comment (although this is typically used for the users real name).

Say for example, you have deleted the user disillusionist by accident, but his home directory still exists:

Code:
ls -l /home
drwx------ 31 1000 1000 4096 2009-05-06 20:55 disillusionist
This would mean that uid 1000 and gid 1000 no longer have valid entries, but the files exist.

Rather than deleting the users files and starting from scratch, you can recreate the group (as root):
Code:
/usr/sbin/groupadd -g 1000 disillusionist
Then recreate the user (as root):
Code:
/usr/sbin/useradd -u 1000 -g 1000 -c "Restoring an account" -d /home/disillusionist -s /bin/bash disillusionist
Veerloh, you may want to read RUTE

Last edited by Disillusionist; 05-07-2009 at 02:11 AM.
 
Old 05-08-2009, 03:14 AM   #21
veerloh
LQ Newbie
 
Registered: May 2009
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks Guys,

Disillusionist..

I will read about RUTE. THnks for all yur help.

 
  


Reply


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Samba SWAT doesnt accept Root Password or User name Matt Perrgo Linux - Newbie 2 07-25-2008 03:33 AM
Unable to login --- Can't enter the password. paragkalra Linux - Software 12 03-17-2008 11:12 AM
password correct but..unable to login?? venki Linux - Newbie 6 01-12-2007 01:51 AM
rsh doesnt accept connections Xris718 Linux - General 3 05-19-2005 03:14 PM
Unable to login (no password prompt) T4urus Linux - General 1 12-21-2003 02:47 PM


All times are GMT -5. The time now is 03:38 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration