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.

36
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 ...
66
votes
4answers
329k 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?
101
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 ...
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, ...
10
votes
1answer
1k views

How to change the forgotten root password?

I forgot my root password...actually I think I know what it is because it is the same password I have for pretty much everything but in the Terminal in tell me "Sorry, try again." Is there a way to ...
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 ...
2
votes
1answer
2k views

Symbolic link not working as expected when changes user

Symbolic link not working, using standard UBUNTU 16 LTS... It shows "Permission denied" where I expected to get access, not working even after chown. Full example: sudo rm /tmp/file.txt # if exist, ...
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 ...
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 ...
31
votes
4answers
62k 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': ...
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 ...
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 "...
9
votes
2answers
24k views

System Crontab or Root Crontab

System crontab: /etc/crontab Root crontab: sudo crontab -u root -e Which way is preferred? As they all run tasks within administration privilege.
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 ...
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 /...
14
votes
1answer
17k views

Why does setuid not work? [duplicate]

I want to ensure that my program can only be run by user xyz using root privilege. To do this, I set the setuid bit with: chmod u+s program1.sh ls -l program1.sh rwsr-x--- 1 root house 1299 May 15 23:...
12
votes
5answers
12k views

How do I drop root privileges in shell scripts?

The "--up" option in OpenVPN is normally used for routing etc. And so it is processed before OpenVPN drops root privileges to run as nobody. However, I am invoking shell scripts that need to run as an ...
13
votes
2answers
16k views

How do I edit a file as root?

Are there any special considerations to editing a file as root? What is the safest way to do this?
15
votes
7answers
5k views

Is it bad practice to set root's shell to something other than the default?

Once a friend of mine (who is an experienced Unix/Linux user) told me that setting root's shell to something other than sh (i.e bash or zsh) might create problems, because some script might assume ...
4
votes
2answers
414 views

Prompt for sudo password rather than give access error

Can I configure Fedora 22 so anything needing root privileges asks for a password, rather than giving an error, and needing me to re-run with sudo? I wouldn't even mind having to type my password ...
4
votes
2answers
3k views

debian su - and su $PATH differences?

$ su - Password: # echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin # exit logout $ su Password: # echo $PATH /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games I have ...
0
votes
1answer
72 views

Does a user have to log in to run a process and become its owner?

In general, does a user have to log in to run a process and become its owner (ruid, or euid)? Does this apply to any user or any non-root user? For example: In the boot sequence of Linux, the kernel ...
71
votes
5answers
16k 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 ...
14
votes
1answer
40k views

Difference between sudo user and root user [closed]

The /etc/sudoers file lists which users can do what with the sudo command The root user creates and modifies the /etc/sudoers file. This concept is difficult for me to understand. If all users ...
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 ...
8
votes
3answers
14k views

What does it mean to be in group 0?

Several users in a system I inherited have their group set to 0 in /etc/passwd. What does that mean? Do they essentially get full root privileges? The system is running CentOS 5, and the users ...
8
votes
4answers
46k views

New user with root access in Linux Debian

I've created a new user by using "User Accounts" in "System Settings". How do I grant rights so that this new user can have the same level of access as root?
6
votes
2answers
8k views

How does the 'passwd' command gain root user permissions?

How does Linux know that it has to give euid 0 (uid of root) to only certain process like passwd, setuid, etc. If a process can gain root permissions, will it not lead to potential security breaches ...
8
votes
1answer
12k views

Why doesn't terminal show color schema once logged as root?

I'm currently using Debian 7 Wheezy, and I've noticed that the colors palette on terminal (which might be useful to identify among a large set of files and folders) are not enabled once I log as root. ...
4
votes
1answer
11k views

I can't access the root account anymore: user is not in the sudoers file

Accidentally removed my gnome desktop and am stuck in tty1. Trying to reinstall the desktop and keep getting the error "user is not in the sudoers file". Having trouble adding my user, new to debian ...
2
votes
2answers
209 views

Are there any gotchas with granting a user root privileges by making them UID=0 GID=0?

I and a friend are administrating a number of virtual machines, each one dedicated to some task in the overall system. When we need to administrate them, we typically log in as root, since the only ...
0
votes
2answers
6k views

Resize root LVM and FS in Debian 7

I have a Debian server and I would like to increase the "root" partition from 5GB to 17GB and to diminish the "home" partition from 14GB to 2GB. Here's the filesystem config: root@APP05:~# df -T Sys....
38
votes
7answers
48k views

Can root kill init process?

Can root kill init process (the process with pid 1)? What would be its consequences?
47
votes
3answers
110k 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 ...
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 ...
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 ...
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 ...
13
votes
6answers
2k views

Is there a root password on OS X and Ubuntu?

When you setup a new Ubuntu or OS X installation a user is generally created for you. On OS X it is whatever username you pick. On Ubuntu (the server version) usually the ubuntu user is created. The ...
12
votes
6answers
38k views

How to get back sudo on Ubuntu?

I have done this: sudo chown -R myname /usr/ and now I can't use the sudo command because of this error: sudo: must be setuid root And as I read this means that the owner of this file /usr/bin/...
9
votes
2answers
58k views

can't ssh into remote host with root, password incorrect

I have a remote host, previously I can ssh into it with root and password ssh root@remote_host or I ssh into it first using a regular user account ssh esolve@remote_host and then su root and input ...
6
votes
2answers
8k views

How do I disable remote root login via ssh?

How do I disable remote root login via ssh? I want to log into my server (I use keys on my main comp) then su into root instead of access root directly. I am using Debian. I follow guides online ...
5
votes
2answers
8k views

What is the difference between these two ways of reseting the root password?

I know several ways to reset root user's password, but want to know which is the best and why it is. For example: A method: Grub > 'e' init=/bin/sh (Remove rhgb and quiet tags if necessary) > ctrl+x /...
4
votes
1answer
5k views

How do I set up busybox to allow a non-root user to set the date?

I have an embedded system built with busy box. I allow a user named "app" to download a program/script to a directory and it will be run on boot. The program should be allowed to set the date. It ...
19
votes
3answers
99k 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 ...
11
votes
3answers
13k views

Write to a file without redirection?

I am writing a regular compiled application that needs to create a special file and write a magic cookie into it. I can’t write the file directly from the application, the system security model ...
8
votes
1answer
1k views

Lightweight virtualization on Linux with user isolation

What Linux-on-Linux virtualization technologies provide user isolation? Specifically, I want root in the virtual machine not to have any privilege on the host. This was not the case for LXC, but was ...
5
votes
1answer
2k views

I changed /etc/sudoers, and now I can't run as sudo

I messed around with the sudoers file without really knowing what I was doing using this link. Assume I did everything that was in the top answer along with editing it with vim and not visudo. How do ...
5
votes
6answers
41k views

Debian 9: can't use sudo

I've recently installed Debian 9 and encountered the following error. During installation I've set up 'root' password and I've set up 'user' with his own password. Later when I log into 'user' ...
4
votes
2answers
3k views

Why does this ssh command not work? (cat ./file | ssh <user@host> “cat | sudo -t -t 'cat > /root/location/file'”)

I'm trying to do the following but it's not quite right. cat ~/Desktop/blah.png | ssh -t -t trusktr@50.116.4.56 "cat | sudo -i 'cat | /path/to/blah.png'" I have my public ssh key in the trusktr@50....
3
votes
1answer
1k views

Is there a way to run a privileged command upon successful SSH login (not necessarily with shell or PTY)?

I'd like to run a privileged command upon successful SSH logins at the server's end. However, this has to be in the server configuration (sshd_config or anything else that cannot be manipulated or ...