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

learn more… | top users | synonyms (1)

39
votes
5answers
77k 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 / ...
38
votes
22answers
14k views

Why change default ssh port? [closed]

I've noticed that a lot of admins change the default ssh port. Is there any rational reason to do so?
38
votes
6answers
4k views

How can you tell what a server actually does? [closed]

I've been handed 3 Linux boxes, 1 front facing with apache on it and another 2 which, as far as I can tell, don't do an awful lot. All running on Redhat. The question is simple: How can I tell what ...
38
votes
5answers
79k views

Top - what does Virtual memory size mean? …linux/ubuntu

I am running top to monitor my server performance and 2 of my java processes show virtual memory of up to 800MB-1GB. Is that a bad thing? What does virtual memory mean? And oh btw, I have swap of ...
38
votes
5answers
18k views

How to understand the memory usage and load average in linux server

I am using a linux server which has 128GB of memory and 24 cores. I use top to see how much it is used. Its output is pasted at the end of the post. Here are two questions: (1) I see that each of the ...
37
votes
2answers
45k views

How to get the url of the current svn repo?

I have 2 svn checkouts that someone setup for me. Now I need to check these same files on another computer, but since I didn't check them out initially I don't know the urls to use when running the ...
36
votes
52answers
6k views

Favorite Unix command line aliases? [closed]

What are your favorite command line aliases (bash/sh/tcsh) aliases? Here are a few of mine. alias lsr='ls -lrt' alias gon='cd $HOME/Notes' alias devdb='mysql -h dev --user=x --password=secret ...
36
votes
7answers
43k 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 ...
36
votes
4answers
84k views

Postfix - how to retry delivery of mail in queue?

I have a backup mail server in case of a failure on the main one. In that case of failure, mails come on the backup server and stay there until the main one is back. If I wait some times, the ...
36
votes
6answers
28k views

How do I permanently disable Linux's console screen saver, system-wide?

I've got an Ubuntu server that boots up in text mode. It rarely has a screen or keyboard attached to it, but when I do attach a screen, I usually have to attach a keyboard too, because the darn ...
36
votes
10answers
4k views

Linux on VMware - why use partitioning?

When installing Linux VMs in a virtualized environment (ESXi in my case), are there any compelling reasons to partition the disks (when using ext4) rather than just adding separate disks for each ...
35
votes
9answers
19k views

Why not block ICMP?

I think I almost have my iptables setup complete on my CentOS 5.3 system. Here is my script... # Establish a clean slate iptables -P INPUT ACCEPT iptables -P FORWARD ACCEPT iptables -P OUTPUT ACCEPT ...
35
votes
13answers
64k views

How to create an SHA-512 hashed password for shadow?

The previous SF questions I've seen have lead to answers that produce MD5 hashed password. Does anyone have a suggestion on to produce an SHA-512 hashed password? I'd prefer a one liner instead of a ...
35
votes
10answers
4k views

Run antivirus software on linux DNS servers. Does it make sense?

During a recent audit we were requested to install antivirus software on our DNS servers that are running linux (bind9). The servers were not compromised during the penetration testing but this was ...
35
votes
10answers
13k views

Securing a fresh Ubuntu server [closed]

Say I've got a fresh install of Ubuntu, what steps should I take to secure it for use as a Rails application server?
35
votes
12answers
41k 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 ...
35
votes
9answers
36k views

Reread partition table without rebooting?

Sometimes, when resizing or otherwise mucking about with partitions on a disk, cfdisk will say: Wrote partition table, but re-read table failed. Reboot to update table. (This also happens with ...
35
votes
1answer
9k views

What is the difference between a 'Login' and an 'Interactive' bash shell

What is the difference between a ‘Login’ and an ‘Interactive’ bash shell? I have quoted Wikipedia below but can anybody give a better answer? EDIT: This is a community wiki so maybe rather than ...
34
votes
6answers
19k views

How do I join two named pipes into single input stream in linux

Using the pipes (|) feature in Linux I can forward chain the standard input to one or several output streams. I can use tee to split the output to separate sub processes. Is there a command to ...
34
votes
5answers
3k views

Intentionally cause an I/O error in Linux?

Is there anyway, with Linux, to purposely cause a block device to report an I/O error, or possibly simulate one for testing purposes?
34
votes
6answers
11k 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 ...
34
votes
1answer
8k 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 ...
33
votes
7answers
41k views

Poodle: Is disabling SSL V3 on server really a solution?

I've been reading all day about the Poodle vulnerability and it I am bit confused now vs Security and Revenue. If I disable SSL V3 on Server (SSL V2 and V3 both will be disabled for Apache) clients ...
33
votes
5answers
3k views

Smoothest workflow to handle SSH host verification errors?

This is a simple issue that we all face and probably resolve manually without giving much thought. As servers change, are re-provisioned, or IP addresses reallocated, we receive the SSH host ...
33
votes
3answers
5k views

Run command in bash without save in history

How to run command in bash without saving it in history?
33
votes
1answer
14k views

Linux FHS: /srv vs /var … where do I put stuff?

My web development experience has started with Fedora and RHEL but I'm transitioning to Ubuntu. In Fedora/RHEL, the default seems to be using the /var folder while Ubuntu uses /srv. Is there any ...
32
votes
11answers
84k views

create home directories after create users

I created some users with: $ useradd john and I forgot to specify the parameter -m to create the home directory and to have the skeleton files copied to each user. now I want to do that, and I ...
32
votes
4answers
9k views

Why does a hardware router perform better than a Linux router with better specs (RAM & CPU)?

I have a minimal CentOS 6.3, 64 bit acting as gateway with 4 NIC (1 Gbps), each bonded together one for public traffic and other for private, which performs NATing. It has 6 GB RAM and 4 logical ...
32
votes
17answers
29k views

Caching/preloading files on Linux into RAM

I have a rather old server that has 4GB of RAM and it is pretty much serving the same files all day, but it is doing so from the hard drive while 3GBs of RAM are "free". Anyone who has ever tried ...
32
votes
16answers
16k 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 ...
32
votes
4answers
25k views

REJECT vs DROP when using iptables

Is there any reason why I would want to have iptables -A INPUT -j REJECT instead of iptables -A INPUT -j DROP
32
votes
8answers
78k views

How to display certain lines from a text file in Linux?

I guess everyone knows the useful Linux cmd line utilities head and tail. Head allows you to print the first X lines of a file, tail does the same but prints the end of the file. What is a good ...
32
votes
1answer
6k views

Why does `tar -xvfz` fail, but `tar xvfz` work?

tar -xvfz foo.tar.gz returns an error tar: z: Cannot open: No such file or directory This is completely understandable - the f switch expects a filename, and so needs to be last. However, omitting ...
32
votes
2answers
29k views

What does a + mean at the end of the permissions from ls -l?

What is the plus sign at the end of the permissions telling me? ls -l total 4 drwxrwxrwx+ 2 benson avahi-autoipd 4096 Jan 27 17:37 docs Here's the context: cat /etc/issue \CentOS release 5.3 ...
31
votes
3answers
9k 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 ...
31
votes
3answers
3k 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 ...
31
votes
4answers
15k 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 ...
31
votes
7answers
52k 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 ...
31
votes
6answers
20k 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 `-- ...
31
votes
1answer
1k views

Why does removing an unused IP address from an interface kill connections unrelated to that address

Yesterday I did a quick reinstall of a (physical) server in the datacenter, and since I was short on time and with no easy access to our database I just assigned it an IP that I knew was available and ...
31
votes
3answers
23k 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 ...
31
votes
6answers
16k 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 ...
30
votes
6answers
4k 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 ...
30
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 ...
30
votes
4answers
31k views

How to convert line breaks in a text file between the Windows and Unix/Linux formats?

How do I convert line breaks in a text file between the Windows and Unix/Linux formats? I have a *nix environment, but that I need to import and export data with the Windows-style line breaks. I ...
30
votes
4answers
51k views

How do I verify the speed of my NIC?

I just installed a new gigabit network interface card (NIC) in Linux. How do I tell if it is really set to gigabit speeds? I see ethtool has an option to set the speed, but I can't seem to figure ...
30
votes
8answers
21k 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?
30
votes
3answers
20k views

Linux command to inspect TXT records of a domain

Is there a linux shell command that I can use to inspect the TXT records of a domain?
30
votes
6answers
35k views

How can I prevent a DDOS attack on Amazon EC2?

One of the servers I use is hosted on the Amazon EC2 cloud. Every few months we appear to have a DDOS attack on this sever. This slows the server down incredibly. After around 30 minutes, and ...
30
votes
2answers
19k views

I have a keypair. How do I determine the key length?

Using OpenSSL from the command line in Linux, is there some way to examine a key (either public or private) to determine the key size?