Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [root]

The "root" account is the most privileged account on a Unix system.

103
votes
4answers
99k views

Reserved space for root on a filesystem - why?

I understand that by default, newly created filesystems will be created with 5% of the space allocated for root. I also know you can change the defined space with: tune2fs -m 1 /dev/sdXY What I'm ...
81
votes
5answers
36k views

Why is root login via SSH so bad that everyone advises to disable it?

Everybody on the Internet advises to disable root login via SSH as it is a bad practice and a security hole in the system, but nobody explains why it is so. What is so dangerous in enabling root ...
73
votes
3answers
11k views

How do the internals of sudo work?

How does sudo work internally? How is it possible that it can become root without having the root password, unlike su? What syscalls, etc. are involved in the process? Is it not a gaping security hole ...
71
votes
5answers
17k views

Becoming root from inside Vim

Sometimes I start editing configuration files in /etc using Vim, but forget to use sudo to start Vim. The inevitable result then is that after finishing my edits I encounter the dreaded notice that I ...
66
votes
4answers
333k views

How do I run a command as the system administrator (root)

I need to run a command with administrative privileges. Someone said I should run a command as root. How do I do this?
63
votes
6answers
10k views

Why does reboot and poweroff require root privileges? [duplicate]

To restart or shut off Linux from the terminal, one can use reboot and poweroff, respectively. However, both of these commands require root privileges. Why is this so? What security risk is posed by ...
61
votes
5answers
129k views

Can I change root's email address or forward it to an external address?

I'm getting a lot of mail in my root user's mail account. This appears to be mostly reports and errors from things like cron scripts. I'm trying to work though and solve these things, possibly even ...
52
votes
2answers
7k views

Origin of 'root' account

What's the origin of root account? Where did it come from and why is it called root anyway? (Originally asked by @lizztheblizz on Twitter.)
51
votes
11answers
17k views

Non-Root Package Managers

From my research, I seem to notice that all package managers insist on being used as a privileged user and must be installed into /. Typically, what I like to do is create a throwaway account, ...
51
votes
1answer
46k views

Why are the first 1024 ports restricted to the root user only?

This is more idle curiosity than anything else. A friend of mine asked me 'which port range is it that only root can use under Linux?' I told him 0-1024 were restricted. Then he asked my why it was so ...
48
votes
3answers
112k views

Unable to delete file, even when running as root

I am in the process of migrating a machine from RHEL 4 to 5. Rather than actually do an upgrade we have created a new VM (both machines are in a cloud) and I am in the process of copying across data ...
44
votes
3answers
199k views

How do you change the root password on Debian?

I want to change the password I assigned to root on my Debian webserver to something longer and more secure. How do I do that? I haven’t forgotten/lost the current password, I just want to change it.
38
votes
7answers
49k views

Can root kill init process?

Can root kill init process (the process with pid 1)? What would be its consequences?
37
votes
5answers
21k views

Can I launch a graphical program on another user's desktop as root?

Following are other questions which I think I need to know: From a non X Session? (meaning root isn't logged into X) If multiple people were logged in on X, could I auto-detect who was on which ...
36
votes
2answers
3k views

How does the power button shut the computer down without root permission?

When I try to shutdown the computer from a command line or terminal I must have root privileges: amy@amy:~$ shutdown now shutdown: Need to be root and amy@amy:~$ halt halt: Need to be root but ...
34
votes
13answers
14k views

Can I create a *super* super-user so that I can actually have a user that can deny permission to root?

I was thinking that it might be advantageous to have a user with permissions higher than the root user. You see, I would like to keep all of the activities and almost all existing root user ...
34
votes
7answers
38k views

Can root/superuser read my read-protected files?

On shared unix hosting, if I have a file sensitive-data.txt and I issue: chmod 600 sensitive-data.txt Can root user still read my file? Specifically I'm wondering if it's safe to store my password ...
33
votes
4answers
53k views

Why doesn't “sudo su” in a shell script run the rest of the script as root?

A sample script can be as below: #!/bin/bash sudo su ls /root When using ./test.sh as the normal user, instead run ls as super user and exit, it switches to root; and when I logout, it executes ls /...
32
votes
3answers
117k views

How do I find out if I am sudoer?

How does Linux system behave when I am not sudoer? Here is what happens if I try to use sudo: server:/tmp>$ sudo cal [sudo] password for user: Sorry, try again. Is it possible that I just don't ...
32
votes
4answers
63k views

Why cannot find read /run/user/1000/gvfs even though it is running as root?

Can someone tell me what I'm doing wrong, what this is, or how to fix it? I'm running Fedora 18 and getting the error shown [root@servername /]# find . -name ngirc find: `./run/user/1000/gvfs': ...
30
votes
1answer
4k views

Why are executables in e.g. /usr/sbin writable by root?

Could you please explain why a binary compiled file (in, for example, /usr/sbin) has write permission for root user? For me, this is compiled. Meaning that direct write has no use and may expose file ...
29
votes
1answer
3k views

Given that root has all privileges, why is root ALL=(ALL) ALL in /etc/sudoers? [duplicate]

I looked at this question: Trying to understand the difference between “modernNeo ALL=(ALL:ALL) ALL” and “modernNeo ALL=(ALL) ALL” in the sudoers file I still have a question. Since the "root" user ...
27
votes
5answers
9k views

How do file permissions work for the “root” user?

I have the following file: ---------- 1 Steve Steve 341 2017-12-21 01:51 myFile.txt I switched the user to root in the terminal, and I have noticed the following behaviors: I can read this file and ...
26
votes
4answers
3k views

How universal is sudo?

I was writing some instructions on how to install something (TeX-related - if you don't ask, I won't ruin your day by supplying more details) and used sudo to install system-wide. Someone commented ...
26
votes
2answers
4k views

Why can't root execute when executable bits are not set?

root user can write to a file even if its write permissions are not set. root user can read a file even if its read permissions are not set. root user can cd into a directory even if its execute ...
25
votes
5answers
45k views

How do you rename root?

Not that it's a very good idea to change it, but for fun. According to this post, there are still some problems even after changing entries in /etc/passwd, /etc/shadow, and /etc/sudoers. Any ...
23
votes
8answers
4k views

Which access rights can't the superuser violate?

Fr. Br. George told in one of his lectures (it's in Russian) that there are some access rights that superuser can not violate. That is there are some access right which can forbid superuser doing ...
23
votes
1answer
27k views

Difference between owner/root and RUID/EUID

I am relatively new to the concepts mentioned in the question and reading about them from different sources only makes them more confusing. So this is what I understood so far: When we are given ...
23
votes
3answers
10k views

How is sudo intended to be used?

I've tried configuring sudo before, but I haven't had too much luck with it. How is it different from su -l -c "x"? It seems that via the configuration file, one can make it so a user can only have ...
22
votes
3answers
4k views

What determines which Linux commands require root access?

What determines which Linux commands require root access? I understand the reasons why it is desirable that, say, apt-get should require root privilege; but what distinguishes these commands from the ...
22
votes
5answers
17k views

How far can you go with rm -rf / as root

If you are root, and you issue rm -rf / Then how far can the command go? Can you recover data from this kind of an action? Even after the binaries are gone, would the running processes still be ...
22
votes
2answers
67k views

What is the difference between 'su -' and 'su root'? [duplicate]

Possible Duplicate: Why do we use su - and not just su? I understand that root doesn't have to be a superuser. But in the case that it is ... what is the difference between sudo su - and sudo su ...
22
votes
3answers
4k views

What script could allow regular users to use network namespaces?

I have an architecture using network namespaces (netns). I would like to allow regular users to do some operations in these netns. I could write a script netns-exec.sh, inspired by this post, ...
21
votes
7answers
7k views

Emptying a file for root user does not work [duplicate]

I use below command to empty a file > file.txt It works perfectly fine! But there are some files with root user permissions. So I tried sudo > different-file.txt and I got below verbose ...
21
votes
1answer
9k views

How to get root inside of vi? [duplicate]

Possible Duplicate: Becoming root from inside Vim It could happen to anyone. The admin types: vi /etc/resolv.conf as a regular user. He edits the /etc/resolv.conf file, but when he wants to hit ...
20
votes
8answers
53k views

Vim Error E138: Can't write viminfo file $HOME/.viminfo!

I'm afraid I've run into something rather strange. When I open a file normally, vim README.txt, everything is fine. But upon sudo vim README.txt, the file renders blank, and gives me a E138: Can't ...
20
votes
4answers
30k views

why does sudo work on Linux but not Android?

I have not had the chance to read enough about Android, Linux, or UNIX to answer this myself. sudo works on a Linux machine but doesn't work on Android unless you root the mobile device (e.g. Samsung ...
20
votes
2answers
28k views

What is the difference between root and superuser?

Do they refer to the same thing or is root just a location in filesystem (its ultimate base) and superuser a privileged user (sort of equivalent of windows administrator account) ? Do they need the ...
20
votes
3answers
4k views

Is it secure to leave a root shell running in detached screen session?

I'm curious about the security of leaving a root shell running inside a detached screen session. I typically never do this. Aside from the potential of my non-root user account being compromised (...
19
votes
2answers
4k views

Two root accounts, what to do?

I'm on Ubuntu 15.04 and today I've been reading an article about Linux security from this link. Everything went good until the part of UID 0 Account Only root should have the UID 0. Another ...
19
votes
5answers
1k views

Commands to learn about an unfamiliar system [closed]

You log in to an unfamiliar UNIX or Linux system (as root). Which commands do you run to orient yourself and figure out what kind of system you are on? How do you figure out what type of hardware is ...
19
votes
3answers
48k views

Get environment variable of other user [closed]

Is there a way I can see the environment variable of an other user? I want to do that as root, so permissions won't be a problem I guess. For the user himself, I use echo $PATH or set | grep PATH (...
19
votes
3answers
100k views

why can't I install packages with rpm? I get “transaction lock” [closed]

I'm having problems with yum and I am trying to re-install it. I've download yum.3.2.0-40-el6.centos.noarch.rpm. When I try: $ rpm -ivh yum.3.2.0-40-el6.centos.noarch.rpm I get: error: can't ...
18
votes
4answers
17k views

'sudo' is not installed, I can't install it, and it asks if I am root

I just finished installing Debian 8 (Jessie) and tried to make a directory in lib/firmware, because there was a file missing (rtl8723befw.bin) in the installation, and it says mkdir: cannot create ...
18
votes
4answers
4k views

Why is root in wheel and operator? Can root being in a group ever make a difference?

I just noticed on my FreeBSD machine that root is in wheel and operator. I'm trying to think of a situation where UID 0 being in a group would have any effect on... well... anything, and I'm coming up ...
17
votes
3answers
147k views

How to change permissions from root user to all users?

I created a folder on the command line as the root user. Now I want to edit it and its contents in GUI mode. How do I change the permissions on it to allow me to do this?
16
votes
4answers
5k views

How to stop a script from running if it's not root (and echo “Not running as root! Exiting…”)

Here's my source: #!/bin/bash echo "Running script to free general cached memory!" echo ""; echo "Script must be run as root!"; echo ""; echo "Clearing swap!"; swapoff -a && swapon -a; echo "...
16
votes
10answers
2k views

Concern about logging in as root overrated?

For personal linux on my personal notebooks, I've usually set my environment to autologin as root even under X or lower runlevels. I've found my workflow is very pleasant and fast, without any ...
16
votes
4answers
9k views

What does “are you root?” mean?

This is what I keep getting: ascendermedia@magic2tower:~$ sudo apt-get install flashplugin-installer bash: sudo: command not found ascendermedia@magic2tower:~$ sudo apt-get install flashplugin-...
16
votes
1answer
7k views

Why does root not have /usr/local in path?

I've noticed that the default path for root on my of my vm's and servers do not include /usr/local/bin sudo -s echo $PATH /sbin:/bin:/usr/sbin:/usr/bin Whereas normal users on the server do have /...