Visit Our UNIX and Linux User Community

HELP ME HELP!!!! I can't Log in as root

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers HELP ME HELP!!!! I can't Log in as root
# 1  
Old 04-15-2002
HELP ME HELP!!!! I can't Log in as root

I am running a Linux Red Hat 7.2 system and I can't log into the root account.

When I tried to su to root from another user by using the command su - root, I get this error message:

su: basename.c:67: base_name:Assertion `all-slashes || !((*(p - 1)) == '/ ' ) failed

also, when I tried to log in to root account from the login prompt, I get a message saying theres an error with my account.

by the way, I am the only one in total control of this system and the system isn't connected to the internet or any network.

Help is needed as soon as possible
# 2  
Old 04-15-2002
Perhaps you have a corrupt password file?
# 3  
Old 04-15-2002
well, how do I fix it????
# 4  
Old 04-15-2002
password corrupted and reboot to single

You may have to reboot to single user mode.

shutdown -ry now and stop it at the interrupt and boot to single user mode. Your shutdown command may have an option to come back to single without interruption from the keyboard.

However, since you can't loging as root. You may have to power off and back on to get to single and use the interrupt method above.

Regarding the password file.
You can do a few things. What are the permissions on your /etc/passwd file? If you can replace it with a backup of the passwd that would be good. If it is truly corrupted. You can just create a new one by hand. Perform an "cat /etc/passwd" then note the lines that are system Ids. Create a new passwd file with vi with just the system IDs.

On my OS there is another minimal passwd file that is under a subdirectory of /etc, /etc/opt/dce/passwd_override.

I don't expect yours to be in the same place, or possibly to have one of these, but it is worth a try.

If you have something like this copy it into place.

# 5  
Old 04-15-2002
I dont get it??

How do I create a /etc/passwd file from a ordinary user. I cant use any superuser power because root is the only supreme power on my system. Now,that the root account is corrupted, I have no idea on what to do.

even if I was to create the /etc/passwd file, what do I put in it and how do I replace the original with this newly created passwd file??

if only there was a safe mode whereas I can go in the root account with minimum powers and make necessary changes then reboot
# 6  
Old 04-15-2002
don't panic.

Please read carefully.

If you have an alternate passwd file, you can use mv to get it into place.

mv alt_passwd /etc/passwd

I want you to check the permissions on the /etc/passwd file. It may be that the permissions are such that you can edit it as a normal user. If the permissions are at least 755, you should be able to replace it with a temporary passwd file. OR Do you have another copy of the passwd file (ie passwd.orig)?

However, if that is not the case, you will have to reboot to single user mode.

IF you have one, you may have to boot with your system disk to get it to come up to single depending on if the system tries to read the passwd file.

If none of these is true, then your options are slim. You have to have one of three things for you to recover.
1) an alternate passwd file you can move into place if the permissions will allow.
2) create a new passwd file with limited users in it, system IDs only.
3) reboot to single and do #2.

If not, then you are stuck. I would suggest in the future to make a tar of your root filesystem for just such an occasion.

Sorry if this doesn't help. The last option as you probably have guessed is reload/reinstall the OS.

Smilie Smilie
# 7  
Old 04-15-2002
Slow down .....

OK, first... answer this questions:

Do you have a password file?

You don't have to be root to see the file or to copy it...... I suggest you post the contents so we can take a look..... thanks.

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

I need it to prompt me for a root password, so I don't have to log as root

Hi folks, I'm trying to install a program, and I want to place some of the executables into /usr/bin so that they can be executed from any folder on the computer. I've been giveng the root password, but told never to log in directly as root. Instead, I can wait for a password prompt. However, I... (2 Replies)
Discussion started by: lunchtime
2 Replies

2. Shell Programming and Scripting

What are the differences between 'bash' and 'sh'

Hopefully this doesn't come off as too much of a "newbie" question or a flamebait. But I have recently begun working with a Sun Solaris box after having spent the past five years working with RedHat. From what i can tell, thing look fairly similar and the 'man' command is some help. But I've... (7 Replies)
Discussion started by: deckard
7 Replies

3. UNIX for Advanced & Expert Users

Can't log in other than root - display garbles

I'm hoping someone here can bail me out of this one. I have a box running SCO Openserver 5.0.2. I can log in as root fine, but if I try to log into any other account, I get: Last succenful login for xxxx "bunch of symbols" Standard copyright stuff and returns to a login... (8 Replies)
Discussion started by: craig2k
8 Replies

4. UNIX for Advanced & Expert Users

How to remove a file with a leading dash '-' in it's name?

Somehow someone created a file named '-ov' in the root directory. Given the name, the how was probably the result of some cpio command they bozo'ed. I've tried a number of different ways to get rid of it using * and ? wildcards, '\' escape patterns etc.. They all fail with " illegal option --... (3 Replies)
Discussion started by: GSalisbury
3 Replies

5. UNIX for Dummies Questions & Answers

mistyped shell path, now i can't login as the only user that can su to root

i mistyped the location of bash and now i can't login as the only other user who belongs to wheel on my freebsd box. since i'm having many problems with samba, this has frozen my attempts to get things resolved with the former issue. i've been told that 'su -m' should do the trick, but it's... (3 Replies)
Discussion started by: xyyz
3 Replies

6. UNIX for Dummies Questions & Answers

quoting echo 'it's friday'

echo 'it's friday' why appear the > (3 Replies)
Discussion started by: yls177
3 Replies

7. UNIX for Dummies Questions & Answers

HELP! The '/var/adm/message' file increase every few seconds???

Hi, guys, I have a big problem. I've got a sun solaris 4.1.4 workstation, and the /var/adm/message file will add one row every few seconds. It becomes a large file in a short time. I wander if there are some mistakes configuring the workstation. the /var/adm/message is as follow: ... (3 Replies)
Discussion started by: cloudsmell
3 Replies

8. UNIX for Dummies Questions & Answers

Can't su to root

I keep getting "su: Your own ID is unknown" whenever I try to su to root. Why is this??? I cannot find anything anywhere with this message. (6 Replies)
Discussion started by: stufine
6 Replies

9. Shell Programming and Scripting

Clearify what it means under 'WHAT' when hit the 'w'-command

I wonder how I shall read the result below, especially 'what' shown below. The result was shown when I entered 'w'. E.g what is TOP? What is gosh ( what does selmgr mean?)? login@ idle JCPU PCPU what 6:15am 7:04 39 39 TOP 6:34am 6:45 45 45 TOP 6:41am ... (1 Reply)
Discussion started by: Aelgen
1 Replies

10. Programming

i can't use 'make' in my computer?

I need to compile a file,but 'make' does not work.please tell me how to use it or need which tools? (3 Replies)
Discussion started by: dsun5
3 Replies

Featured Tech Videos