shalom
Posts: 2
Joined: Thu May 14, 2015 5:15 am

how to use the root

Fri May 15, 2015 6:14 am

how to install the root?
how can use the root?
what is the use of root?

User avatar
MarkHaysHarris777
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

Re: how to use the root

Fri May 15, 2015 6:19 am

shalom wrote:how to install the root?
how can use the root?
what is the use of root?
If you have to ask, you don't need to know. :cry:

Ok, I'll give you a break... root is the highest authority on the system, with which you may use it to do anything your heart desires, including destroying the system (hint: its dangerous)

root is disabled by default... that is a good thing. Yes, you can enable it---don't.

If you need root privileges then use sudo... for instance to install this font set you could:

sudo apt-get install xfonts-base

The sudo gives you root authority for that one activity temporarily. That is the best way to use root. It is a bad idea to enable root (generally speaking, unless you're a power user and you know what you're doing) and it is a really bad idea to logon as root routinely... really bad.

Just use sudo... (if there is a need)
marcus
:ugeek:

User avatar
rpdom
Posts: 17275
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: how to use the root

Fri May 15, 2015 6:22 am

shalom wrote:how to install the root?
how can use the root?
what is the use of root?
You do not need to install root.

root is the name of a user. A very powerful user. root can do anything. root is like administrator.

In Raspbian on the Pi you can run programs from the command line using root by putting the "sudo" command in front of what you want to run (sudo = "SuperUserDO")

For example

Code: Select all

pi@raspi2 ~ $ fdisk -l
fdisk: cannot open /dev/mmcblk0: Permission denied
did not work because I was not "root" user.

But

Code: Select all

pi@raspi2 ~ $ sudo fdisk -l

Disk /dev/mmcblk0: 7.4 GiB, 7948206080 bytes, 15523840 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00014d34

Device         Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk0p1        8192   122879   114688   56M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      122880 15523839 15400960  7.4G 83 Linux
does work, because "sudo" made me root user for that command.

User avatar
AndyD
Posts: 2334
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: how to use the root

Fri May 15, 2015 6:57 am

There is a very long explanation here.

klricks
Posts: 7172
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: how to use the root

Fri May 15, 2015 1:45 pm

If you want to stay root for more than one command then do:

Code: Select all

sudo su
When done type exit to get back to user pi

However it is very rare that you would ever need to do that.
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

Return to “Beginners”