root is the default administrative account for Unix-based systems. It is comparable to the Administrator account of a Windows system.

learn more… | top users | synonyms

98
votes
23answers
8k views

How do you make it obvious you are on a production system?

A few of us at my company have root access on production servers. We are looking for a good way to make it exceedingly clear when we have ssh'd in. A few ideas we have had are: Bright red prompt ...
40
votes
3answers
3k views

nice sudo or sudo nice?

is there any difference between running an intensive task over sudo with the following commands?: nice sudo [intensive command here] sudo nice [intensive command here] BTW this is for Linux 3.x.
29
votes
10answers
8k views

Why su to root instead of logging in as root?

I've heard often that it is better to su to root rather than log in directly as the root user (and of course people also say that it's even better to use sudo). I've never really understood why one ...
29
votes
4answers
72k views

Adding a directory to $PATH in CentOS?

We just got our new server(s) up and we're running CentOS on them all. After successfully installing Ruby Enterprise Edition, I would now like to add the REE /bin (located at ...
28
votes
9answers
4k views

Multiple Linux sysadmins working as root

In our team we have three seasoned Linux sysadmins having to administer a few dozen Debian servers. Previously we have all worked as root using SSH public key authentication. But we had a discussion ...
22
votes
4answers
5k views

vim re-edit as root

I often open a file in vim, make some changes and when it's time to save the file is read-only.. (owned by another user). I'm looking for tips on how I could re-open the file as root and keep my ...
22
votes
8answers
4k views

accidently ran “chown www-data:www-data / -R” as root

i just ran this a few seconds ago, i managed to do ctrl-c as soon as i realized what i started doing. so far in the only dir its started going through is /bin im afraid to do anything else, so far ...
19
votes
4answers
3k views

Ordinary users are able to read /etc/passwd, is this a security hole?

ls -l /etc/passwd gives $ ls -l /etc/passwd -rw-r--r-- 1 root root 1862 2011-06-15 21:59 /etc/passwd So an ordinary user can read the file. Is this a security hole?
17
votes
8answers
5k views

Should we disable the root user?

Should we remove the root password, disable remote login and basically require adminstrators to use sudo to perform administrative actions?
15
votes
5answers
47k views

How do I list all users with root?

On a linux box, how do I list all users that have root priveleges (and even better, all users in general along with if they have root or not)?
14
votes
4answers
11k views

Bash Scripting: Require script to be run as root (or with sudo)

I'm trying to write a bash script (in Ubuntu) that will backup a directory using tar. How can I do a check in the script so that it can only be run as root (or with sudo)? For instance, if a user ...
14
votes
2answers
813 views

how do i perform root actions from non-root account?

I want to be able to restart services from a php-script. running under the www-user account. What's the preferred way to perform these actions? I recon I can place create a file with que'd commands, ...
13
votes
7answers
17k views

How do I disable root login in Ubuntu?

a while ago I gave root a password so I could log in as root and get some stuff done. Now I want to disable root login to tighten security, since I'm going to be exposing my serve to the internet. ...
13
votes
5answers
17k views

what permission to write PID file in /var/run

Ubuntu touch: cannot touch `/var/run/test.pid': Permission denied I am starting start-stop-daemon and like to write the PID file in /var/run start-stop-daemon is run as my-program-user /var/run ...
12
votes
11answers
7k views

Best way to go about changing a root password on 3000+ Solaris, AIX, and Linux servers?

Long story short: Big old corporation, lots of UNIX/Linux servers. I inherited responsibility for a bunch of scripts that that left a few years ago. One of them was a script that would be run every ...
11
votes
7answers
24k views

Chown operation not permitted for root

I try to chown the owner of a file to root, but I can't. I'm doing this as root. I get the following message: chown: changing ownership of `ps': Operation not permitted
11
votes
2answers
613 views

What is the difference between “sudo -i” and “sudo bash -l”

There is a recent question regarding multiple sysadmins working as root, and sudo bash -l was referenced. I searched for this on google and SE, but I don't understand the difference between sudo ...
11
votes
2answers
2k views

What's the best solution to manage root password of thousands servers

I'm a system administrator. In the production environment I need to manage thousands of servers. My colleagues and I uses a central manage server and distribute its public key through other servers. ...
9
votes
4answers
908 views

root full Linux. No free blocks

df -h reports the '/' partition to be 100% full. While running du -hs * on each directory of this partition shows there is still lot of space. tune2efs which reports just one block to be free. Ran ...
9
votes
4answers
28k views

How to configure vsftpd to allow root logins?

I'm on SLES 10.1, and trying to configure vsftpd to allow root logins. Does anyone know how to do this? So far, I have this: local_enable=YES chroot_local_user=NO userlist_enable=YES ...
8
votes
6answers
451 views

Why shouldn't root be allowed to login via ssh?

why should root access be disabled for ssh? I always hear that's for security reasons. But I don't get it. What's different to login as non-root and then sudo su -? What's the preferred way to handle ...
8
votes
4answers
673 views

Remote Root Login

I know one of the first things you do to secure a server is disallowing remote root login. Passwords are pretty weak; what do people think of only allowing root login via ssh keys or other ...
8
votes
1answer
577 views

Allow password access for all users except root?

I want to leave the root user enabled on my servers for convenience, and the only reason people are against the idea (that I know of) is brute-force attacks on SSH. So, is there is a way in SSH to ...
8
votes
4answers
344 views

Who gets root access?

I'm working on a web application which handles some sensitive data. We're getting pretty tight on security, and laying out policies to lock down access to machines, and log everything for technical ...
8
votes
2answers
683 views

Accidently locked myself out of MySQL by changing the host

While trying to get remote MySQL working, I somehow managed to lock myself out with the root account. Normally, I would stop the MySQL service and restart it using /etc/init.d/mysql --init-file, but ...
8
votes
4answers
6k views

Allow root login from one IP address only

I have centos5. Is there any way that i can log into my vps server with root user from particular ip address only. I have read that i can use private key to login into sshd. But the problem is i am ...
8
votes
1answer
2k views

AWS - removing ec2-user from sudo list

I'm running a production-level Amazon ec2 instance, and I want to close out root privileges to all users. Normally, when one logs in to the instance as ec2-user, the ec2-user immediately gets sudo ...
7
votes
6answers
596 views

Why are we advised to not log into SSH as Root [duplicate]

Possible Duplicate: Why shouldn't root be allowed to login via ssh? Hi, Why is it safer to not log in as root via SSH? Since the login is SSH protected the root password is not in plain ...
7
votes
2answers
3k views

should use sudo or just su root in server management?

Which approach is better? For desktop usage, it seems that sudo is better since: I can have a more consistent history as a normal user Don't need to remember two passwords, which is especially ...
7
votes
5answers
852 views

Why would sshd allow root logins by default?

I'm currently working on hardening my servers against hacking- amongst other things, i'm getting a load of attempts to log on as root over ssh. While i've implemented fail2ban, i'm wondering, why root ...
7
votes
3answers
3k views

How to get the number of available updates on an Ubuntu system as a normal user

I need this for a simple monitoring script which i don't want to run as root...
7
votes
3answers
11k views

Procedure to forward root email to external email

I would like to forward the emails received by root to an external email on an Ubuntu node. I have seen this post, but it does not explain much about the procedure to follow. There are some other ...
7
votes
4answers
5k views

Ubuntu - can non-root user run process in chroot jail?

Is it possible for a non-root user to run a chroot process on Ubuntu?
6
votes
7answers
507 views

Server was hacked. Now login wont accept 'root' as username comes up invalid

On Fedora, root is coming up invalid. WHat is solution?
6
votes
2answers
4k views

What is the difference between `su` and `su -` in CentOS?

I tried to switch to root in CentOS by running su, but it does change to root, but it doesn't seem to be a real root user. For example, by default, ifconfig command in /sbin is not found in the path ...
6
votes
1answer
770 views

Why is the root user named root by default?

This might seem like a silly question but I could see this as being confusing. For example: "Go to root directory" Could be interpreted as: Go to / Go to ~root (usually /root/) I would think ...
6
votes
4answers
1k views

Correct user names when tracking /etc/ in git repository and committing as root

We use git to track changes in /etc/ on our servers. Administrators work as root when changing files in /etc/, and thus their commits have author root <root@machinename> This is not very ...
6
votes
4answers
14k views

Why (or how) does the number of open file descriptors in use by root exceed ulimit -n?

Our server recently ran out of file descriptors, and in regards to that I have some questions. ulimit -n is supposed to give me the maximum number of open file descriptors. That number is 1024. I ...
6
votes
2answers
21k views

Debian: how to create a user with root privileges (sudo)

How do I create a user with root privileges in Debian? Maybe it sounds a bit silly, but I don't think I need user directories, only some rights to run services (mainly web server, mysql, etc.). I just ...
6
votes
1answer
561 views

PostgreSQL: Living without root

This is not a question with a concrete answer, I know, but one that seeks experienced views... The OS environment I run is as vanilla as possible so it's often undesirable to install things into root ...
5
votes
5answers
1k views

Linux - How to manage the password of root?

We have just deployed a couple of Linux server. Each sysadmin will have his own account on the server (i.e.: jsmith), and will connect using SSH with a certificate which will be put into the ...
5
votes
3answers
1k views

Why does 'pkill /?' kill my SSH session?

After running the following commands (bash) as root via SSH: pkill --help pkill -h pkill /? The first two commands didn't provide me any information, that's why ran the third (kinda ...
5
votes
5answers
14k views

ubuntu: let a user run a script with root permissions

I have ubuntu 8.04 and I want to write a bash script that runs as root which every user can run. I myself can do sudo. How do I do that? CLARIFICATION: I don't want to do it with sudo, because then ...
5
votes
4answers
3k views

ubuntu - how can I avoid typing a password on every admin action?

I just set-up ubuntu 9.10 on my computer, and I'm trying to figure out how to avoid typing a password on every action that requires sudo privileges. I just want to type a password once on login and ...
5
votes
5answers
3k views

SSH - How to include “-t command” in the ~/.ssh/config file

I use ~/.ssh/config file so that I can easily enter ssh myserver and it'll provide the correct username, port, hostname, identity file, etc. However for many servers, the first thing I do is enter su ...
5
votes
3answers
3k views

Rsync over ssh with root access on both sides

I have one older ubuntu server, and one newer debian server and I am migrating data from the old one to the new one. I want to use rsync to transfer data across to make final migration easier and ...
5
votes
3answers
200 views

Where I work everybody logs in as root

Where I work now, I am forced to use the root account just like everybody else there does. There are no other users. Not even in the DBs. My seniors explained to me that this is done for convenience's ...
5
votes
1answer
264 views

Ports below 1024

DISCLAIMER: I know how to run daemons that either listen on ports <1024 by using privbind or some iptables REDIRECT. Or more generally spoken, how to make daemons available on priviliged ports that ...
4
votes
8answers
1k views

protecting my files from root

In a remote box, my files are 700-chmoded, but I'm worried that root may be reading them. Is there a way to add another layer of protection to avoid that, perhaps by encrypting them, but allowing ...
4
votes
6answers
3k views

If I change the root password on a linux server, can someone still access root if they created an SSH authorized_key for root user?

I'm not even sure if I asked that right. Anytime someone mentions changing the root password, they mention changing /etc/passwd, or just using the passwd command, but I've never heard of having to ...