The "root" account is the most privileged account on a Unix system.
28
votes
4answers
1k 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 ...
24
votes
5answers
6k 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?
21
votes
7answers
2k 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, ...
19
votes
1answer
1k 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 regulare user. He edits the /etc/resolv.conf file, but when he ...
19
votes
2answers
878 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 ...
19
votes
1answer
911 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 ...
17
votes
4answers
11k 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 ...
16
votes
3answers
748 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 ...
15
votes
2answers
1k 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.)
14
votes
3answers
4k views
How does sudo work?
I've tried messing around with 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 ...
12
votes
4answers
603 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 ...
12
votes
4answers
3k 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 ...
12
votes
3answers
3k 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 ...
12
votes
1answer
3k 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 ...
11
votes
6answers
1k 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 ...
10
votes
11answers
903 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 ...
10
votes
2answers
3k 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 ...
10
votes
3answers
3k 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 ...
10
votes
3answers
14k views
Can I change root's email address or forward all mail 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 ...
9
votes
4answers
733 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 ...
9
votes
3answers
741 views
Is it safe to close shell just by clicking “X” or using “ctrl+d”?
Is it safe to close shell just by clicking "X" or using "ctrl+d" while logged in as root with su or is it safer to close it by typing "exit"? Is there any difference (security-wise) at all or is it ...
9
votes
1answer
4k 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 ...
8
votes
5answers
7k views
Can root kill init process?
Can root kill init process (the process with pid 1)? What would be its consequences?
7
votes
1answer
420 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 ...
6
votes
7answers
959 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 ...
6
votes
4answers
218 views
How do I stop the root user from deleting a file?
I'd like to know if I can prevent the root user from deleting a file.
Is it possible?
6
votes
5answers
4k views
Is it possible to put root in LVM without using initrd?
I have just set up a Gentoo base system (which means I can boot and log in and do stuff with it now). My root partition is in an LVM2 virtual group (with a separated /boot partition). In order to boot ...
6
votes
2answers
318 views
How to hinder root from running a script
The Glassfish application server provides scripts to administer the application server and also start and stop them and I would like to restrict the root user from running this script. The reason is ...
6
votes
7answers
762 views
Negatives/downsides of Ubuntu's no-root sudo setup
By default, Ubuntu does not create a root account that the user can login to. Instead users use sudo when they need to perform actions that require administrative access.
Obviously, the people at ...
6
votes
1answer
156 views
Can I launch a process as root without launching root's login shell?
I tried to change the login shell.
Here's what the first line of /etc/passwd looks like (on a Debian Wheezy install):
rootx:0:0:root:/root:/:zsh
When I try to login as root:
Cannot execute zsh: ...
6
votes
1answer
501 views
Jailbreaking HDTV
I have a Vizio internet TV, the predecessor to this one with basically the same specs, not 3D though. I wanted to try and gain root access to the tv.
Using nmap I leaned that the only port open is ...
5
votes
2answers
10k 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.
Bit of an obvious newbie question, but how do I do that? I haven’t forgotten/lost the ...
5
votes
2answers
3k views
Unable to delete file, even as root
I've got a file on remote machine (saying that, cause I don't know who the heck created it), that I've to remove.
user@machine:~/folder$ ls
lift_proto.db.lock.db
And permissions are like this:
...
5
votes
2answers
487 views
make a 2nd root?
I was thinking, maybe i'd like to disable passwords for the root user and only use keys to log in. and if i need to login without keys have a 2nd user that is like root in everyway except has a ...
5
votes
2answers
2k 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 ...
5
votes
1answer
2k 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 ...
5
votes
3answers
5k views
Why is Debian's root shell colorless?
Are there any security concerns? What is the best way to enable it?
5
votes
3answers
181 views
Are sudo and gksudo safe?
I noticed after running a sudo command in terminal or running a administrative application that uses gksudo, it won't ask again for the password for a time (something like 5 minutes).
Now let's ...
5
votes
1answer
3k views
How to run a GUI program as a different user (Debian)?
Using a terminal, I can change the running user with su and sudo — but how can I do that by clicking on an icon/shortcut on the desktop/start menu?
If I have to be root to execute I will be asked ...
5
votes
1answer
179 views
Ubuntu: If anyone can get a root prompt without password, isn't that compromising the gnome keyring?
I've been looking for this for quite a while now but couldn't find a satisfying answer.
My scenario:
I'm using encfs to encrypt a few directories in my home folder. To make it easier to access I set ...
4
votes
4answers
731 views
How sudo/root-ness detection works
Programs that make changes system-wide require sudo unless I am already the root user.
Now, the question is: how exactly does the system figure out that I am (not) root?
Does it:
Check to see if ...
4
votes
2answers
3k 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 ...
4
votes
2answers
6k 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 ...
4
votes
1answer
222 views
SSH login as root fails, but I'm sure I entered the right password
What am I missing? I change the root password on a unix machine, then try to log in with that password. PasswordAuthentication is set to yes in sshd_config and the sshd daemon has been restarted. ...
4
votes
3answers
251 views
Give a warning when something is about to be deleted (by root)
I know that root can do anything, but is there a way to at least alert root that they are about to delete a folder that perhaps shouldn't be deleted?
We keep a work directory in our /tmp folder, and ...
4
votes
2answers
106 views
System files with strict permissions
Usually, when we run
ls -l
we can see such picture -rwx...- so the owner always has the full stack of permissions.
And usually the owner of the system files is the root. Are there any system files ...
4
votes
1answer
564 views
How can I resize my root partition in Debian?
I am trying to add space to my root partition and am really not sure the safest way to go about it. I have read this thread, Can I resize the root partition without uninstalling and reinstalling ...
4
votes
1answer
165 views
Mounting from dolphin vs commandline
I have been wondering how this is possible (i.e. how this works internally). When you want to mount a directory you have to be root.
sudo mount /dev/something /mnt/somedir
I know you can get around ...
3
votes
2answers
204 views
Force change of a user's cwd as root
I'm looking to change a user's process such that I can set it's cwd.
Related, and secondary to the question, I have a filesystem I want to unmount but a user is sitting on it with a bash process. I ...
3
votes
1answer
2k views
How to have cron run a python script as root?
How can I get cron to run a python script as root? Here is my crontab file:
0 * * * * ./twitter/twitter.py
Am I doing something wrong?