Questions tagged [root]

In an Ubuntu system, root is the superuser, the owner of most system files. Questions about the root user or accessing superuser privileges may use this tag; the / or /root directories may be more appropriately tagged with "filesystem"

root is the name used for the super user account in Ubuntu, which has all permissions to control files and directories in the system. The privileged status of this account is associated not with the name "root" but with its UID - root is UID 0

The majority of system files belong to root and normal users do not have permission to modify them. This makes the system more secure, as it is difficult for an unprivileged user to cause serious damage.

In Ubuntu, by default there is no password for root. This means that you cannot su root (switch user to root) as this would require root's password. Instead of switching user to root or logging in as root, normal users can elevate privileges using the sudo (superuser do) command. By default, the first human user account created will have UID 1000 and the right to run any command with sudo privilege. Other user accounts may be granted this permission, and other options may be configured, using the /etc/sudoers file, which should always be edited with the visudo command.

Related tags:

1769 questions
564
votes
13 answers

Execute sudo without Password?

Inspired by this question.... I am the sole person using my system with 12.04. Every time I issue a sudo command; the system asks for the user password (which is good in its own way). However I was thinking; without activating the root account; how…
BhaveshDiwan
  • 11,506
  • 10
  • 35
  • 46
273
votes
14 answers

How do I copy files that need root access with scp?

I have an Ubuntu server to which I am connecting using SSH. I need to upload files from my machine into /var/www/ on the server, the files in /var/www/ are owned by root. Using PuTTY, after I log in, I have to type sudo su and my password first in…
226
votes
22 answers

Why is it bad to log in as root?

I've often come across posts on forums or other websites where you see people joking in such a manner about running/logging in as root as if it's something awful and everyone ought to know about it. However, there isn't much that a search reveals on…
Mussnoon
  • 5,236
171
votes
11 answers

How can a script check if it's being run as root?

I'm writing a simple bash script, but I need it to check whether it's being run as root or not. I know there's probably a very simple way to do that, but I have no idea how. Just to be clear: What's a simple way to write a script foo.sh, so that the…
Malabarba
  • 10,546
166
votes
5 answers

How to enable root login?

I would like to enable the root account on my Ubuntu installation. I realize the security implications of this.
Lincity
  • 25,749
157
votes
7 answers

How do I run a 'sudo' command inside a script?

To do a patch manually I must type this command sudo ./playback_delete_data_patch.sh 09_delete_old_data_p.sql There is a space just before the 09: sudo ./playback_delete_data_patch.sh [space] 09_delete_old_data_p.sql How can I run this inside…
user251948
  • 1,571
145
votes
5 answers

How to enable ssh root access on Ubuntu 14.04

I´d like to enable the ssh root access on Ubuntu 14.04. Editing the /etc/ssh_config (PermitRootLogin yes) didn't affect anything.
user283163
  • 1,459
134
votes
4 answers

Changing from user to superuser

How do I change from user to superuser (root)? What command do I use in the Terminal to switch to root? I have tried --help but I get lost with all the listed help. I'm looking for a recent download/install so I can use it.
pcgeek
  • 1,341
133
votes
12 answers

/usr/bin/sudo must be owned by uid 0 and have the setuid bit set

I have run following command accidentally sudo chown [username] -hR / Now sudo su getting error: sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set How to Solve This?
Pandya
  • 37,289
116
votes
5 answers

How do I login as root?

I want to login as root, but when I enter sudo -s and enter password, this message is shown: "you are not in sudoers file", and when I enter su and enter password, this is shown: "authentication failure". My os has one account only. about past1…
ava
  • 1,163
110
votes
7 answers

What is the difference between "gksudo nautilus" and "sudo nautilus"?

I've been using gksudo nautilus and sudo nautilus through Alt+F2. What's the difference? They look very similar!
DrKenobi
  • 6,552
95
votes
1 answer

How do I boot into a root shell?

When booting to the graphical desktop fails we sometimes are recommended to boot into a "root shell" or to boot in "recovery mode". How do I do that?
Takkat
  • 144,580
89
votes
4 answers

What is the default root password?

I installed Ubuntu 12.04 LTS (Precise Pangolin), 64 bit. Nowhere was I asked to set password for root. I just installed AccuRev SCM software. It was installed under the /root folder by default. Now I try do something on that folder. I tried with su…
5YrsLaterDBA
  • 1,135
86
votes
3 answers

When to use pkexec vs. gksu/gksudo?

There are two general ways to run applications graphically as root (or, more generally, as another user). Programs like gksu, gksudo, and kdesudo are graphical frontends for sudo. In contrast, pkexec is a graphical frontend for PolicyKit. When…
Eliah Kagan
  • 119,640
83
votes
6 answers

Read / Write permissions in /opt directory

I installed Android Studio in my /opt directory without a hitch and have been using it. Recently, though, Android Studio informed me of an update. It won't perform the update, however, because it says it doesn't have Read / Write permissions in the…
wayneeusa
  • 969
1
2 3
99 100