HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- /etc/passwd deleted
Operating System - HP-UX
1834513
Members
1870
Online
110068
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2006 06:13 PM
12-29-2006 06:13 PM
hi all,
if my /etc/passwd file deleted? is it possible to recover my system? i don't have a backup?
Thanks in advance
if my /etc/passwd file deleted? is it possible to recover my system? i don't have a backup?
Thanks in advance
Be an expert
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2006 07:41 PM
12-29-2006 07:41 PM
Solution
Hi,
If you are logged in as root, copy the strings below into the /etc/passwd file
root::0:3::/:/sbin/sh
daemon:*:1:5::/:/sbin/sh
bin:*:2:2::/usr/bin:/sbin/sh
sys:*:3:3::/:
adm:*:4:4::/var/adm:/sbin/sh
uucp:*:5:3::/var/spool/uucppublic:/usr/lbin/uucp/uucico
lp:*:9:7::/var/spool/lp:/sbin/sh
nuucp:*:11:11::/var/spool/uucppublic:/usr/lbin/uucp/uucico
hpdb:*:27:1:ALLBASE:/:/sbin/sh
nobody:*:-2:-2::/:
www:*:30:1::/:
smbnull:*:101:101:DO NOT USE OR DELETE - needed by Samba:/home/smbnull:/sbin/sh
webadmin:*:40:1::/usr/obam/server/nologindir:/usr/bin/false
iwww:*:102:1::/home/iwww:/sbin/sh
owww:*:103:1::/home/owww:/sbin/sh
hpsmh:*:79:79:System Management Homepage:/home/hpsmh:/sbin/sh
sshd:*:104:102:sshd privsep:/var/empty:/bin/false
mysql:*:105:103::/home/mysql:/sbin/sh
The file is good for a fresh system.
If you can not log in, reboot the system for single user mode and create /etc/password file withe strings above.
After that you will have to find UIDs for all existnig users and insert them into /etc/passwd either manually or by useradd.
Good Luck
If you are logged in as root, copy the strings below into the /etc/passwd file
root::0:3::/:/sbin/sh
daemon:*:1:5::/:/sbin/sh
bin:*:2:2::/usr/bin:/sbin/sh
sys:*:3:3::/:
adm:*:4:4::/var/adm:/sbin/sh
uucp:*:5:3::/var/spool/uucppublic:/usr/lbin/uucp/uucico
lp:*:9:7::/var/spool/lp:/sbin/sh
nuucp:*:11:11::/var/spool/uucppublic:/usr/lbin/uucp/uucico
hpdb:*:27:1:ALLBASE:/:/sbin/sh
nobody:*:-2:-2::/:
www:*:30:1::/:
smbnull:*:101:101:DO NOT USE OR DELETE - needed by Samba:/home/smbnull:/sbin/sh
webadmin:*:40:1::/usr/obam/server/nologindir:/usr/bin/false
iwww:*:102:1::/home/iwww:/sbin/sh
owww:*:103:1::/home/owww:/sbin/sh
hpsmh:*:79:79:System Management Homepage:/home/hpsmh:/sbin/sh
sshd:*:104:102:sshd privsep:/var/empty:/bin/false
mysql:*:105:103::/home/mysql:/sbin/sh
The file is good for a fresh system.
If you can not log in, reboot the system for single user mode and create /etc/password file withe strings above.
After that you will have to find UIDs for all existnig users and insert them into /etc/passwd either manually or by useradd.
Good Luck
Entities are not to be multiplied beyond necessity - RTFM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2006 02:26 AM
12-30-2006 02:26 AM
Re: /etc/passwd deleted
This would be a major problem. First, only the root user can delete files in /etc so do not give the root password to anyone that is not properly trained as a system administrator. And if your system is Trusted, recovering your system is much more complicated. Your first step is to completely backup your system -- use SAM and create an fbackup tape. Then make a second tape using Ignite so you can recover from a dead boot disk.
Now if the passwd file has truly been removed and you have no backup, you can re-create the original file like this:
cp /usr/newconfig/etc/passwd /etc/passwd
chmod 755 /etc/passwd
Now all of this assumes you are logged on as root. If not logged in as root or you can't login at all, then you may be able to use the core HP-UX CDROM to boot up and recover the passwd file that way.
Bill Hassell, sysadmin
Now if the passwd file has truly been removed and you have no backup, you can re-create the original file like this:
cp /usr/newconfig/etc/passwd /etc/passwd
chmod 755 /etc/passwd
Now all of this assumes you are logged on as root. If not logged in as root or you can't login at all, then you may be able to use the core HP-UX CDROM to boot up and recover the passwd file that way.
Bill Hassell, sysadmin
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP