0

If you use sudo su - or sudo -s you will have full root privileges.

Is this root user an official user or is it from Canonical?

~$ sudo su -
[sudo] password for username: 
root@lp:~# id
uid=0(root) gid=0(root) groups=0(root)
root@lp:~# pwd
/root
root@lp:~# 
Zanna
  • 70,465
hwez
  • 2,976
  • 1
  • 17
  • 15
  • root is the all powerful uber-user. root exists in Unix and all versions of Linux. Some Linux versions require you to set up a password for root others such as Ubuntu don't and use sudo instead. – Warren Hill Aug 06 '14 at 12:56

2 Answers2

6

Yes the root user is an official one.

That user comes from a long line of historical influences. It's the conventional name of the user who has all rights or permissions. Most Unix-linke operating systems have a root user. It's not always called "root". You may know the Administrator of Windows operating systems.

The sudo program allows one to perform some action as root, such as run a command, run a shell, or log in (in a terminal only). Using sudo allows one to access root privilege only as needed, conforming to the principle of least privilege. The sudo program also provides control over the execution environment for the commands run with it, i.e. whether root's user configurations or your own are used when commands are run.

In Ubuntu, logging in as the root user directly is disabled by default, to make it less likely that one will cause damage to the system or create security problems by making some mistake as root.

The root user can do things that a normal user cannot for example:

  • Change the owner and permissions of files/directories, regardless of the current owner or permissions
  • Bind network ports below 1024

The root user always has the UID 0 and can be identified by this UID. It is possible to create another user called root, but not for there to be two users with the same UID, hence, there is only one root. It is compulsory to have such a user.

Short digression about sudo:

The sudo program works because it has the "suid-bit" (set user id bit). This allows any user to run the program as the owner of the program. Obviously, this is an enormous security risk, and so sudo performs strict checks to see whether the user attempting to run it has the right to use sudo at all, and which commands they are allowed to run with it. This configuration is stored in the file /etc/sudoers, which should only be edited with the visudo command (you need sudo to run visudo). During installation, one sets up a first user account in Ubuntu. This first user will automatically have the right to run any command with sudo.

If the sudo executable or /etc/sudoers have wrong permissions, sudo will refuse to run.

Zanna
  • 70,465
chaos
  • 27,506
  • 12
  • 74
  • 77
0

It is root.

In Ubuntu root defaults to having no password set so you have to sudo su - or sudo -s to login as root. Or if you really wanted, set a password for root and bypass the need for sudo (not adviseable)

sudo su -

Open the root users default environment, So you get the root users shell etc..

sudo -s

Will open the shell defined in the variable$SHELL or /etc/passwd for the invoking user not the root user. This method you get to keep some extra enviromental variables so you know who done the sudo etc...

squareborg
  • 10,517