Root: Difference between revisions

From OLPC
Jump to navigation Jump to search
m (→‎Becoming root: you click icons, not press them)
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<tt>root</tt> is the most powerful user on a linux based computer system. It allows you to execute any command that is available to it.
{{Code|root}} is the most powerful user on a linux based computer system. It allows you to execute any command that is available to it.


It will even allow you to execute commands that are harmful to your system. For example, '''you could delete all of the contents of a folder, or important system files by accident.'''
It will even allow you to execute commands that are harmful to your system. For example, '''you could delete all of the contents of a folder, or important system files by accident.'''


It is very important that you be careful when using the <tt>root</tt> user.
It is very important that you be careful when using the {{Code|root}} user.


The best option is to type [[sudo]] ("super-use do... ") at the start of individual commands you want to run as root, for example <tt>sudo rpm ''options</tt>.
The best option is to type {{Code|[[sudo]]}} ("super-user do... ") at the start of individual commands you want to run as root, for example {{Code|sudo rpm ''options}}.
But sudo is not available in early releases such as build 650 ("ship.1", release 7.1.0).


== Becoming root ==
== Becoming root ==
There are several ways to permanently become the root user on an XO:
There are several ways to become the root user on an XO:
* In later versions of the [[Terminal Activity]] you can become "root" by clicking the "#_" icon at the top of the terminal screen.
* at the [[Terminal Activity|terminal]] shell prompt type {{Code|su}} and press enter:
% su
* In builds earlier than 703 you may need to instead enter <tt>[[su -l]]</tt> in the Terminal Activity.
#
* In the [[Virtual terminal]] [[console]] you can login as root. In later builds this happens automatically when you press Enter; in earlier builds, press enter and when prompted to "Login:", enter <tt>root</tt>
* switch to the [[console]], where the shell is automatically root,
* use a [[Serial Adapters|serial port]], where the shell is automatically root.


== Checking root ==
The root user's prompt in a terminal normally ends with <tt>'''#'''</tt> rather than <tt>'''$'''</tt>. You can enter the command <tt>who</tt> to check who you are.
When the process is root, the shell prompt normally ends with {{Code|'''#'''}} rather than {{Code|'''$'''}}. This is the easiest way to check. Other ways are:
* enter the command {{Code|who}} to check who is logged on.
* enter {{Code|whoami}} to check the effective userid rights of the active session, it will be 0 for root.


==See Also==
==See Also==
* [[su]] The "su" command
* [[su]] The "su" command
* [[sudo]] The "sudo" command
* [[sudo]] The "sudo" command

[[Category:HowTo]]

Latest revision as of 07:34, 10 August 2013

root is the most powerful user on a linux based computer system. It allows you to execute any command that is available to it.

It will even allow you to execute commands that are harmful to your system. For example, you could delete all of the contents of a folder, or important system files by accident.

It is very important that you be careful when using the root user.

The best option is to type sudo ("super-user do... ") at the start of individual commands you want to run as root, for example sudo rpm options.

Becoming root

There are several ways to become the root user on an XO:

  • at the terminal shell prompt type su and press enter:
 % su
 # 
  • switch to the console, where the shell is automatically root,
  • use a serial port, where the shell is automatically root.

Checking root

When the process is root, the shell prompt normally ends with # rather than $. This is the easiest way to check. Other ways are:

  • enter the command who to check who is logged on.
  • enter whoami to check the effective userid rights of the active session, it will be 0 for root.

See Also

  • su The "su" command
  • sudo The "sudo" command