-   Linux - Newbie (
-   -   Renaming Root (

Maniyar.Taufiq 03-03-2009 11:50 AM

Renaming Root
I have changed the name of my root account in /etc/passwd as "abc", After that I can not be able to login as root, neither can i use the name "abc" for login. Is their any method to overcome this problem.

pixellany 03-03-2009 11:56 AM

That was something you did NOT want to do----but I supect you already know that now.....;)

You can recover by rebooting into single-user mode and editing the file: When the GRUB menu appears, hit "escape" to get into text mode, then hit "e" for edit. Select the kernel line, "e" again, and add the word "single" (no quotes) at the end. Hit enter, and then "b" to boot. You will boot up into a terminal, running as root.

You can also boot from a live CD and edit the file from there.

Tinkster 03-03-2009 12:51 PM

And in addition to that: the procedure only went pear-shaped because
you only changed the entry in /etc/passwd, and the entry in /etc/shadow
didn't match ...

T74marcell 03-03-2009 01:20 PM

What did you plan to achieve by renaming root?

If you only wanted a different username with root privileges, then you should have created a new user, and then adding it to the sudoers list. I'm sure you will find a lot of Google results for sudo and sudoers to explain how that is to be done.


Arch Linux

Tinkster 03-03-2009 01:25 PM

Obfuscation ;}

If you use a weak password like 0rANge, making the username something
like falafel instead of root makes it harder to gain access ;D

synss 03-03-2009 02:52 PM

root is a user with UID=GID=0. So to change the name, you just create a user with UID=GID=0 and lock root. Although, I would also recommend locking root anyway and using sudo instead, like the user above said.

anomie 03-03-2009 05:02 PM

Use vipw(8) if you're going to edit /etc/passwd. And changing the root account's name should be # 1,001 on your list of 1,000 ways to secure GNU/Linux. (i.e. It didn't make the list.)

All times are GMT -5. The time now is 04:46 PM.