Beginner user here.
I want to change root username to something else? Is that possible, and if yes - how to do it?
Beginner user here.
I want to change root username to something else? Is that possible, and if yes - how to do it?
Yes it is possible, but not recommended. The username root
is not magical. The fact that it has a UID
of 0 is what gives root
its power. Tools like /bin/ls
that translate between the UID
value in a file's inode and a name (unless you /bin/ls -n
) use the password database
(See man nss;man nsswitch.conf
) to do the translation. The getent
command fetches entries:
$ getent passwd root
root:x:0:0:root:/root:/bin/bash
(See man 5 passwd;man shadow
for info about the contents.)
So, you could edit /etc/passwd
, find the line with the UID
of zero, and change the user name of root
to some other value.
What do you suppose you have gained? Do you know of any program dumb enough to check for $USERNAME = "root" rather than
$UID = 0`? The system sure doesn't.
No, it is not possible. In Windows, you can have guests and admins. In Ubuntu, there are guests, admins and the root. And nobody can actually BE the root, only use root powers. So no, there is no way to change the root's name.
PermitRootLogin no
to prevent anyone from logging in as root. If this is a server you should also disable Password Authentication and use Public Keys instead. – levlaz Jul 12 '15 at 01:48