Lost /etc/passwd file


 
Thread Tools Search this Thread
Operating Systems Solaris Lost /etc/passwd file
# 1  
Old 06-05-2012
Lost /etc/passwd file

Hello,

I'm trying to recover my /etc/passwd file, but I can't make it work. Im doing the following:

1. Booting from cd-rom:
Quote:
boot cdrom -s
2. Mounting hard disk drive
Quote:
# fsck -y /dev/dsk/c1t0d0s0
# mount /dev/dsk/c1t0d0s0 /a
3. Copying my passwd and shadow files to /a/etc/
Quote:
# cp /etc/passwd /a/etc/passwd
# cp /etc/shadow /a/etc/shadow
4. Unmounting Hard disk:
Quote:
# cd
# umount /a
5. Rebooting
Quote:
# reboot
6. Stopping my OS from booting ( by pressing Stop+A).

7. Booting with -s option
Quote:
{0} ok boot -s
The Next message appears:
Quote:
Type control -d to proceed with normal startup, ( or give root password for system maintenance).
Any ideas?

Thanks in advance.

---------- Post updated at 11:24 AM ---------- Previous update was at 10:07 AM ----------

Ok I got it, but is there anyway to recover the /home directories of my users?
# 2  
Old 06-05-2012
Depends how you lost them. What actually happened to your system here?
This User Gave Thanks to Corona688 For This Post:
# 3  
Old 06-05-2012
Your users /home directories may well be on a non-root filesystem and still be intact. Do you know where they resided??

As Corona688 asks, how did this happen? What problem are you fighting here?
This User Gave Thanks to hicksd8 For This Post:
# 4  
Old 06-05-2012
I was trying to recover root's password but I accidentally erased /etc/passwd file, so I restored this file from the cdrom.

After doing this, I executed de pwconv command and recovered root's password, but lost two of my users:

oradevx
appldevx

So I created this users again and I'm trying to get their home directories.
# 5  
Old 06-05-2012
Messing up /etc/passwd won't remove their home directories.
This User Gave Thanks to Corona688 For This Post:
# 6  
Old 06-05-2012
Is there any file in which I can check my users' home directory? By the way, some of my files are having an ID as an owner instead as a user name, is there any way to solve this?
# 7  
Old 06-05-2012
The usual location is /home/username but it can be anything. find / -type d -name username should help locating them.

About the numeric file userids, that likely means you recreated oradevx and appldevx accounts with a wrong (i.e. different) user id. You can simply fix the /etc/passwd and /etc/shadow files.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

When did AIX start using /etc/security/passwd instead of /etc/passwd to store encrypted passwords?

Does anyone know when AIX started using /etc/security/passwd instead of /etc/passwd to store encrypted passwords? (1 Reply)
Discussion started by: Anne Neville
1 Replies

2. Shell Programming and Scripting

Finding my lost file by searching for words in it

Got a question for you guys...I am searching through a public directory (that has tons of files) trying to find a file that I was working on a longggggg time ago. I can't remember what it is called, but I do remember the content. It should contains words like this: Joe Pulvo botnet zeus... (5 Replies)
Discussion started by: statichazard
5 Replies

3. UNIX for Dummies Questions & Answers

help with passwd file

Not an unix expert, I read a few pages on the web about passwd files, but I didn't find the answers I need about the last 8 lines of the passwd file I'm taking a look at. I'm assuming their shortcuts to another file that may have the actual usernames of users on the system. Please, any help... (1 Reply)
Discussion started by: fusion31
1 Replies

4. Solaris

passwd cmd reenables passwd aging in shadow entry

Hi Folks, I have Solaris 10, latest release. We have passwd aging set in /etc/defalut/passwd. I have an account that passwd should never expire. Acheived by emptying associated users shadow file entries for passwd aging. When I reset the users passwd using passwd command, it re enables... (3 Replies)
Discussion started by: BG_JrAdmin
3 Replies

5. UNIX for Dummies Questions & Answers

Lost file

I have another problem. I have a text file in which I had written a number of quotations to use in my paper. Luckily, I know that the file is somewhere in my ~/UnixCourse directory or in some subdirectory directly or indeirently within it. I also know that the file name ended in '.txt'. I know i... (1 Reply)
Discussion started by: starwind4
1 Replies

6. Shell Programming and Scripting

help in /etc/passwd file

Hi all, As all of us know that in /etc/passwd file the first field correspond to username could any one tell me what is bin , damoen etc in the first field, and r they in user field , what is nologin in the last column ? root:x:0:0:root:/root:/bin/bash ... (4 Replies)
Discussion started by: useless79
4 Replies

7. Solaris

Lost space on file system

Hi everybody, I got a problem on my SUN server in Solaris 9. I'll try to explain, if somebody could help me. I have mounted some volumes in RAID 0+1, that is stripped slices and then mirror. To be clear the result of metastat d80 is as follow : d80: Mirror Submirror 0: d81 State:... (2 Replies)
Discussion started by: aribault
2 Replies

8. Cybersecurity

/etc/passwd file

hi Does anyone anyone know what the last line of a unix user passwd file signifes? Mine shows "+:::::" best (4 Replies)
Discussion started by: s_mad010
4 Replies

9. Filesystems, Disks and Memory

Lost Data Lost Admin

First time so excuse my ignorance please. I may not be accurately describing the issue. I have inherited a small lab mostly SUN V120s. We lost power and are trying to recover. Nope no backups... The primary issue I have is 1 box is an Oracle Server. It has 2 36Gb harddrives. I am able to... (3 Replies)
Discussion started by: murphsr
3 Replies
Login or Register to Ask a Question