You are not logged in.

#1 2010-03-26 10:23:11

zero-giulio
Member
Registered: 2010-01-23
Posts: 70

How to rename the root user?

As title...

Or, alternatively, how I can create an user with the same privilege as root (i.e., a user that can do EVERYTHING) renaming it as I like?

Offline

#2 2010-03-26 10:30:39

daba
Member
Registered: 2010-03-24
Posts: 20

Re: How to rename the root user?

Afaik you can't have multiple root users. The root privilege is bound to the user id 0 - and users ids must be unique. You *could* change the root username by modifying /etc/passwd and /etc/shadow or simply using usermod - however, I strongly discourage of doing this, it will most likely break your system because alot of scripts and maybe even binary programs rely on root actually having the username root.
But you might want to consider some more replies, because my knowledge on this subject is rather plainly.

Last edited by daba (2010-03-26 10:32:49)

Offline

#3 2010-03-26 10:47:35

NilsKunnas
Member
From: United States
Registered: 2010-03-25
Posts: 18

Re: How to rename the root user?

Unix-like systems do support more than one user with id 0, NetBSD for example, which comes with a "Toor" account. I would think you could create an alternative user with id 0 and disable the original root user, but to me, that is just security by obscurity.


Arch Linux = Teh Happy!

Offline

#4 2010-03-26 10:49:53

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: How to rename the root user?

Set up sudo, ???, profit!

Because running everything with root privs is a really really really bad idea.

Last edited by Mr.Elendig (2010-03-26 10:50:43)


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#5 2010-03-26 10:50:16

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: How to rename the root user?

Why do you think you need a user with the same privileges as root? If you think about it carefully, you will find that you don't IMO.

Are you familiar with su/sudo?

Offline

#6 2010-03-26 11:15:40

Melonie
Member
Registered: 2010-03-26
Posts: 8

Re: How to rename the root user?

sudo, if properly configured, will allow you to do EVERYTHING you want.


AMD Sempron ™ 2600+ 1.6GHz - 512MB of RAM - NVidia FX5200 ( 128MB )

Offline

#7 2010-03-26 11:43:17

toad
Member
From: if only I knew
Registered: 2008-12-22
Posts: 1,775
Website

Re: How to rename the root user?

Sounds like you want to have X starting as root as well... All possible, but the quicker way would be to to a rm -r /* immediately after successful install big_smile


never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::

Offline

#8 2010-03-26 11:48:33

Mektub
Member
From: Lisbon /Portugal
Registered: 2008-01-02
Posts: 647

Re: How to rename the root user?

Melonie wrote:

sudo, if properly configured, will allow you to do EVERYTHING you want.

Well, isn't that root, just disguised ?

Anyhow, you can have more then one user with ID 0, any user regular name, any homedir and any shell.

Mektub


Follow me on twitter: https://twitter.com/johnbina

Offline

#9 2010-03-26 11:56:56

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: How to rename the root user?

Mektub wrote:
Melonie wrote:

sudo, if properly configured, will allow you to do EVERYTHING you want.

Well, isn't that root, just disguised ?

Nope, because it will only run stuff as root when explicitly told so.


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#10 2010-03-26 12:31:38

Peasantoid
Member
Registered: 2009-04-26
Posts: 928
Website

Re: How to rename the root user?

toad wrote:

Sounds like you want to have X starting as root as well... All possible, but the quicker way would be to to a rm -r /* immediately after successful install big_smile

Tread carefully - this guy may not know that's a joke. Also he may not know what rm does, so... What I'm trying to say is don't be a dick, even by accident. Telling people to rm -r / is a very bad idea, because they might actually go and do it, and then it's your fault.

Offline

#11 2010-03-26 13:05:20

tlaloc
Member
From: Lower Saxony
Registered: 2006-05-12
Posts: 359

Re: How to rename the root user?

Peasantoid wrote:
toad wrote:

Sounds like you want to have X starting as root as well... All possible, but the quicker way would be to to a rm -r /* immediately after successful install big_smile

Tread carefully - this guy may not know that's a joke. Also he may not know what rm does, so... What I'm trying to say is don't be a dick, even by accident. Telling people to rm -r / is a very bad idea, because they might actually go and do it, and then it's your fault.

Yeah, even when considered a joke, it was a bad one ...

Offline

#12 2010-03-26 13:05:23

brianhanna
Member
Registered: 2009-10-30
Posts: 157

Re: How to rename the root user?

This is a popular trick in Windows.  People often remove the "administrator" username or even better, leave it there and give it no priviliges so it works as a honey pot for someone trying to break into your system.

I've run into a couple cases when sudo did not work correctly on Arch and I had to fall back on su so I'm not sure deleting root and only using sudo is a good solution for us.

Offline

#13 2010-03-26 14:19:01

hatten
Arch Linux f@h Team Member
From: Sweden, Borlange
Registered: 2009-02-23
Posts: 736

Re: How to rename the root user?

Idiots, go run rm -rf / in a terminal and you'll notice that nothing happens.

Offline

#14 2010-03-26 14:49:36

Melonie
Member
Registered: 2010-03-26
Posts: 8

Re: How to rename the root user?

hatten wrote:

Idiots, go run rm -rf / in a terminal and you'll notice that nothing happens.

That's not quite what toad said ..

1. It was rm -r /*, not rm -rf /.
2. He was talking about a fresh install, which means you would run it as root, not a regular user.

Last edited by Melonie (2010-03-26 14:51:34)


AMD Sempron ™ 2600+ 1.6GHz - 512MB of RAM - NVidia FX5200 ( 128MB )

Offline

#15 2010-03-26 15:04:20

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: How to rename the root user?

hatten wrote:

Idiots, go run rm -rf / in a terminal and you'll notice that nothing happens.

I wouldn't exactly consider people who're concerned about the safety of their systems to be idiots.  rm -rf / (or rm -r /* or whatever) is a dangerous command to run, period, whether or not recent versions have a safeguard around it.

It's like saying "Newer guns have safeties.  If you don't put a gun to your head and pull the trigger, you're an idiot."

In any case, back on topic, as other posters have said I'd recommend against renaming root or making another user with root privileges.  It's more than likely the wrong solution to whatever problem you're trying to solve.

Offline

#16 2010-03-26 15:29:28

daba
Member
Registered: 2010-03-24
Posts: 20

Re: How to rename the root user?

If you are afraid of people loggin in with the root account simply bang his password in /etc/shadow and the account will no longer be able to login. You should be sure that you have sudo configured correcly though when doing this, because you might lock yourself out of root access to your machine by doing this if not so.

Last edited by daba (2010-03-26 15:29:47)

Offline

#17 2010-03-26 20:12:26

Peasantoid
Member
Registered: 2009-04-26
Posts: 928
Website

Re: How to rename the root user?

hatten wrote:

Idiots, go run rm -rf / in a terminal and you'll notice that nothing happens.

Irrelevant. See Cerebral's comment.

Offline

#18 2010-03-26 20:23:55

hatten
Arch Linux f@h Team Member
From: Sweden, Borlange
Registered: 2009-02-23
Posts: 736

Re: How to rename the root user?

Oh well, I shouldn't have used such a harsh tone. Not that you needed to either =p
I didn't notice that he used /*, which would do something, although when pesantoid answered he didn't have the wildcard.
And I bet a new installation is fairly up to date, but the random newbie that browses this might always always run it (although that'll teach them to not run random commands)

Last edited by hatten (2010-03-26 20:25:16)

Offline

#19 2010-03-26 22:31:18

KimTjik
Member
From: Sweden
Registered: 2007-08-22
Posts: 715

Re: How to rename the root user?

As suggested the idea probably has it "roots" in Windows. Difference though is that Administrator also by default has remote permissions, but you don't really need to do more than to strip Administrator's remote permissions (if someone is allowed to access the server then about everything else is of no use... or maybe that gun Cerebral was talking about) and add another account to the administrator group and give it remote permissions.

As long as root isn't allowed to be accessed by ssh or similar there's no point in being obscure beyond reason. If that gun is put to your head you better don't have data more valuable than your life.

Offline

Board footer

Powered by FluxBB