Linux is the generic term for a UNIX-like open source operating system based on the Linux kernel.

learn more… | top users | synonyms (3)

30
votes
6answers
32k views

How to setup linux permissions for the WWW folder?

Updated Summary The /var/www directory is owned by root:root which means that no one can use it and it's entirely useless. Since we all want a web server that actually works (and no-one should be ...
29
votes
7answers
2k views

How to create a symbolic link without using ln?

I deleted a critical symbolic link - libc.so.6. I have the file it should point at, but the basic commands such as ln or wget won't work anymore due to the link missing. However, echo or other Bash ...
29
votes
8answers
3k views

How do I know I'm running inside a linux “screen” or not?

The "screen" refers to a program mentioned in How to reconnect to a disconnected ssh session . That is a good facility. But there is a question I'd really like to know. How do I know whether I'm ...
29
votes
4answers
27k views

How to run a command multiple times?

Is there a way to run a command (e.g. ps aux|grep someprocess) for n times? Something like: run -n 10 'ps aux|grep someprocess' I want to use it interactively, please do not post scripts. ...
29
votes
5answers
31k views

How to setup passwordless `sudo` on Linux?

How can passwordless sudo access be setup on either RHEL (Fedora, CentOS, etc) or Ubuntu distributions? (If it's the same across distros, that's even better!) Setting: personal and/or lab/training ...
29
votes
1answer
5k views

Why are my XFS filesystems suddenly consuming more space and full of sparse files?

I've run XFS filesystems as data/growth partitions for nearly 10 years across various Linux servers. I've noticed a strange phenomenon with recent CentOS/RHEL servers running version 6.2+. Stable ...
29
votes
3answers
16k views

Tuning Linux IP routing parameters — secret_interval and tcp_mem

We had a little failover problem with one of our HAProxy VMs today. When we dug into it, we found this: Jan 26 07:41:45 haproxy2 kernel: [226818.070059] __ratelimit: 10 callbacks suppressed Jan 26 ...
29
votes
3answers
18k views

What's best practice for communication between Amazon EC2 instances?

I've been setting up Amazon EC2 instances for an upcoming project. They are all micro instances, running Ubuntu Server 64bit. Here's what I've setup so far: Web Server -- Apache Database Server ...
28
votes
10answers
7k 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 ...
28
votes
4answers
8k views

Bind to ports less than 1024 without root access

I would like to run applications I'm working on that binds to port numbers less than 1000 without requiring root access. I'm using Linux Mint and have root access to set it up. I would ideally like ...
28
votes
7answers
29k views

What is the debian-sys-maint MySQL user (and more)?

I have been bitten several times by the 'debian-sys-maint' user that is installed by default on the mysql-server packages installed from the Ubuntu repositories. Generally what happens is I pull a ...
28
votes
14answers
12k views

Linux - Running The Same Command on Many Machines at Once

I have about a dozen Linux boxes that I occasionally need to run the same command(s) on. Is there an easier way (or automated way) to do this asides from logging on to each machine and running the ...
28
votes
11answers
23k views

Linux: how to prevent a user from login in, but allow “su - user”

How do you allow a user to log in using "su - user" but prevent the user from login in using SSH? I tried to set the shell to /bin/false but the when I try to su it doesn't work. Are there several ...
28
votes
3answers
3k views

Run command in bash without save in history

How to run command in bash without saving it in history?
28
votes
8answers
3k views

Securing PHP webservers

PHP applications have a reputation for higher than average security problems. What configuration techniques do you use for making sure the application is secure as possible? I'm looking for ideas ...
27
votes
9answers
3k 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 ...
27
votes
6answers
7k views

How to determine the “age” of a linux system since installation?

any ideas please ? first off I thought that I could easily check the timestamp of particular files, but then I realized that it wouldn't be so easy when I saw timestamps like 1991 :-)
27
votes
6answers
18k views

Merge 2 directory trees in Linux without copying?

I have two directory trees with similar layouts, i.e. . |-- dir1 | |-- a | | |-- file1.txt | | `-- file2.txt | |-- b | | `-- file3.txt | `-- c | `-- file4.txt `-- ...
27
votes
5answers
2k views

How can a Linux Administrator improve their shell scripting and automation skills?

In my organization, I work with a group of NOC staff, budding junior engineers and a handful of senior engineers; all with a focus on Linux. One interesting step in the way the company grows talent is ...
27
votes
5answers
2k views

Linux hardening - web servers

What are your checklist/routine when setting up a Linux web server? What do you recommend to achieve maximum security? Is there any preferred way to perform repeated maintenance?
26
votes
14answers
12k views

File Server - Storage configuration: RAID vs LVM vs ZFS something else…?

We are a small company that does video editing, among other things, and need a place to keep backup copies of large media files and make it easy to share them. I've got a box set up with Ubuntu ...
26
votes
3answers
51k views

How to install/change locale on Debian?

I've written a web application for which the user interface is in Dutch. I use the system's date and time routines to format date strings in the application. However, the date strings that the system ...
26
votes
6answers
1k views

Top-like tool for IP traffic [closed]

I need to keep watch on how much bandwidth some connections are taking in a server, and I know I have seen a top-like tool for that before. However, I can't remember the name of the tool, and I'm not ...
25
votes
5answers
2k views

Linux server out of space

I have been asked this question in two consecutive interviews, but after some research and checking with various systems administrators I haven't received a good answer. I am wondering if somebody can ...
25
votes
3answers
3k views

Does getting disconnected from an SSH session kill your programs?

So, say I get disconnected from an SSH-session after I've started rsync or cp or any other command that can be long running. Does that command keep running until it's finished after I get disconnected ...
25
votes
6answers
31k views

FreeBSD vs Linux performance? [closed]

I know that FreeBSD is famous for being highly stable, secure and of course open source. So I am going to try it on one of my servers. However, I am wondering what are the pros and cons of Using ...
25
votes
7answers
11k views

What is a good solution to encrypt some files in unix?

I am looking for a utility to encrypt certain directories in Linux. I am not looking for any full disk encryption services, but simply to encrypt a few directories for the purposes of storing files in ...
25
votes
4answers
2k views

Why Swap is used when plenty of free memory is left?

I have pretty good web (dedicated) server with good memory resource System information Server load 2.19 (8 CPUs) Memory Used 29.53% (4,804,144 of 16,267,652) Swap Used 10.52% ...
25
votes
8answers
13k views

Allow SCP but not actual login using SSH

Is there any way to configure a user on a Linux box (Centos 5.2 in this case) so that they can use scp to retrieve files, but can't actually login to the server using SSH?
25
votes
5answers
24k views

When does /tmp get cleared?

I'm taking to putting various files in /tmp, and I wondered what the rules on deleting them are? I'm imagining it's different for different distributions, and I'm particularly interested in Ubuntu ...
25
votes
6answers
38k views

How to interrupt software raid resync?

I want to interrupt a running resync operation on a debian squeeze software raid. (This is the regular scheduled compare resync. The raid array is still clean in such a case. Do not confuse this with ...
25
votes
5answers
23k views

Linux: how to restore config file using apt-get/aptitude?

I've occasionally lost my config file "/etc/mysql/my.cnf", and want to restore it. The file belongs to package mysql-common which is needed for some vital functionality so I can't just purge ...
25
votes
3answers
7k views

The XFS filesystem is broken in RHEL/CentOS 6.x - What can I do about it?

Recent versions of RHEL/CentOS (EL6) brought some interesting changes to the XFS filesystem I've depended on heavily for over a decade. I spent part of last summer chasing down an XFS sparse file ...
25
votes
4answers
11k views

How useful is mounting /tmp noexec?

Many people (including the Securing Debian Manual) recommend mounting /tmp with the noexec,nodev,nosuid set of options. This is generally presented as one element of a 'defense-in-depth' strategy, by ...
24
votes
14answers
10k views

How do I find out what version of Linux is running?

Sometimes your scripts need to behave differently on different Linux's. How can I determine which version of Linux a script is running on?
24
votes
3answers
1k views

Did a cat /dev/urandom - Broken terminal

Out of curiosity, when your shell character set breaks from doing something like cat /dev/urandom is there a way to fix that in place?
24
votes
7answers
39k views

How to get e-mail from (failed) cron-jobs in Ubuntu?

I create cron-jobs in Ubuntu by placing the executable in one of /etc/cron.{daily,hourly,monthly,weekly}. There are lots of directories starting with cron: kent@rat:~$ ls -ld /etc/cron* drwxr-xr-x 2 ...
24
votes
6answers
7k views

Meaning of directories on Unix and Unix like systems

I've been using Linux for a couple of years now but I still haven't figured out what the origin or meaning of some the directory names are on Unix and Unix like systems. E.g. what does etc stand for ...
24
votes
8answers
5k views

How do you setup ssh to authenticate using keys instead of a username / password?

How do you setup ssh to authenticate a user using keys instead of a username / password?
24
votes
15answers
2k views

How much is IP V6 addressing being used?

Just how much IP V6 addressing is really in typical use out there? I see that Linux/UNIX seems to be ready for this. But I don't see the readiness as much as the Windows side. Especially not for ...
24
votes
7answers
2k views

Ubuntu, how to setup a new machine like an existing one

I have one machine setup with the apps I need, and I'd like to install the same on a new Ubuntu box. Is there a script that will list all the installed apps, so that I can diff between the boxes and ...
24
votes
7answers
16k views

Why rsync is faster than NFS?

Few days ago I noticed something rather odd (at least for me). I ran rsync copying the same data and deleting it afterwards to NFS mount, called /nfs_mount/TEST. This /nfs_mount/TEST is ...
24
votes
5answers
54k views

Practical maximum open file descriptors (ulimit -n) for a high volume system

We recently began load testing our application and noticed that it ran out of file descriptors after about 24 hours. We are running RHEL 5 on a Dell 1955: CPU: 2 x Dual Core 2.66GHz 4MB 5150 / ...
24
votes
2answers
763 views

Why is it bad to have root writing files to a directory not owned by root?

This came up in a comment to another question and I'd love it if someone could explain the reasons for this to me. I suggested having Apache log the errors for a given VHost to a user's home ...
24
votes
6answers
13k views

filesystem for millions of small files

Which Linux filesystem would you choose for best speed in the following scenario: a hundred million files ~2k file size in average >95% read access pretty random access high concurrency (>100 ...
24
votes
1answer
1k views

Minimal rate and default class problem for HTB

I have some doubts about a HTB structure I'm using. My aim is to limit the download and upload speed of users in a local network. Each user of the network has a personal list of domains with a down ...
23
votes
3answers
2k views

Why is Linux reporting “free” memory strangely?

This is a canonical question about how Unix operating systems report memory usage. Similar Questions: Server refuses to use swap partition Memory Usage in LINUX I have production ...
23
votes
3answers
15k views

Turn off the Linux OOM killer by default?

The OOM killer on Linux wreaks havoc with various applications every so often, and it appears that not much is really done on the kernel development side to improve this. Would it not be better, as a ...
23
votes
7answers
4k views

Reasons to disable / enable SELinux

In the line of this question on StackOverflow and the completely different crowd we have here, I wonder: what are your reasons to disable SELinux (assuming most people still do)? Would you like to ...
23
votes
13answers
4k views

Linux IO monitoring per file?

I am interested in a utility or process for monitoring disk IO per file on CentOS. On Win2008, the resmon utility allows this type of drilldown, but none of the Linux utilities I have found do this ...