Questions tagged [linux]

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

Filter by
Sorted by
Tagged with
389 votes
7 answers

Why is my crontab not working, and how can I troubleshoot it?

This is a Canonical Question about using cron & crontab. You have been directed here because the community is fairly sure that the answer to your question can be found below. If your question is ...
Eric Leschinski's user avatar
372 votes
6 answers

What permissions should my website files/folders have on a Linux webserver?

This is a Canonical Question about File Permissions on a Linux web server. I have a Linux web server running Apache2 that hosts several websites. Each website has its own folder in /var/www/. /var/...
Nic's user avatar
  • 13.5k
45 votes
3 answers

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 ...
user avatar
175 votes
18 answers

Disk full, du tells different. How to further investigate?

I have a SCSI disk in a server (hardware Raid 1), 32G, ext3 filesytem. df tells me that the disk is 100% full. If I delete 1G this is correctly shown. However, if I run a du -h -x / then du tells me ...
initall's user avatar
  • 2,325
103 votes
6 answers

Tips for Securing a LAMP Server

This is a Canonical Question about Securing a LAMP stack What are the absolute guidelines for securing a LAMP server?
Aditya Shukla's user avatar
271 votes
2 answers

Why is "chmod -R 777 /" destructive?

This is a Canonical Question about File Permission and Why 777 is "destructive". I'm not asking how to fix this problem, as there are a ton of references of that already on Server Fault (reinstall OS)...
samwise's user avatar
  • 2,413
217 votes
8 answers

Setting the hostname: FQDN or short name?

I've noticed that the "preferred" method of setting the system hostname is fundamentally different between Red Hat/CentOS and Debian/Ubuntu systems. CentOS documentation and the RHEL deployment guide ...
Cakemox's user avatar
  • 25.4k
60 votes
5 answers

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 ...
Tim's user avatar
  • 1,497
30 votes
5 answers

Can I bind a (large) block of addresses to an interface?

I know that the ip tool lets you bind multiple addresses to an interface (eg, Right now, though, I'm trying to build something on top of IPv6,...
p-static's user avatar
  • 403
234 votes
4 answers

What's the best way of handling permissions for Apache 2's user www-data in /var/www?

Has anyone got a nice solution for handling files in /var/www? We're running Name Based Virtual Hosts and the Apache 2 user is www-data. We've got two regular users & root. So when messing with ...
Gareth's user avatar
  • 8,573
77 votes
3 answers

How to handle relative urls correctly with a reverse proxy

I have a reverse proxy setup as follows in Apache: Server A with address is the reverse proxy server. It maps to: Server B with address This kind of works....
Hard worker's user avatar
41 votes
7 answers

du vs. df difference [duplicate]

I have a fileserver where df reports 94% of / full. But according to du, much less is used: # df -h / Filesystem Size Used Avail Use% Mounted on /dev/sda3 270G 240G 17G 94%...
Andreas Kuntzagk's user avatar
202 votes
4 answers

Meaning of the buffers/cache line in the output of free

Why does my server show total used free shared buffers cached Mem: 12286456 11715372 571084 0 81912 6545228 -/+ buffers/cache: 5088232 7198224 Swap:...
Muahmmad Zeeshan's user avatar
83 votes
16 answers

Hundreds of failed ssh logins

Every night I get hundreds, sometimes thousands, of failed ssh logins on my RedHat 4 server. For firewall reasons from remote sites, I need to run on the standard port. Is there anything I should be ...
MattMcKnight's user avatar
145 votes
8 answers

How can I port forward with iptables?

I want connections coming in on ppp0 on port 8001 to be routed to on eth0 on port 8080. I've got these two rules -A PREROUTING -p tcp -m tcp --dport 8001 -j DNAT --to-destination 192....
Stu's user avatar
  • 2,198
108 votes
2 answers

How to do the port forwarding from one ip to another ip in same network?

I would like do some NAT in iptables. So that, all the packets coming to and port 80 will be forwarded to port 80. How to do this with iptables? Or Any other ways to ...
sat's user avatar
  • 1,283
195 votes
6 answers

LVM dangers and caveats

I have recently started using LVM on some servers for hard drives larger than 1 TB. They're useful, expandable and quite easy to install. However, I could not find any data about the dangers and ...
Adam Matan's user avatar
  • 13.4k
53 votes
9 answers

Why would a server not send a SYN/ACK packet in response to a SYN packet

Lately, we've become aware of a TCP connection issue that is mostly limited to mac and Linux users who browse our websites. From the user perspective, it presents itself as a really long connection ...
codemonkey's user avatar
339 votes
27 answers

Can I automatically add a new host to known_hosts?

Here's my situation: I'm setting up a test harness that will, from a central client, launch a number of virtual machine instances and then execute commands on them via ssh. The virtual machines will ...
gareth_bowles's user avatar
283 votes
13 answers

Can I nohup/screen an already-started process?

I'm doing some test-runs of long-running data migration scripts, over SSH. Let's say I start running a script around 4 PM; now, 6 PM rolls around, and I'm cursing myself for not doing this all in ...
ojrac's user avatar
  • 2,933
9 votes
5 answers

Why does Red Hat Linux report less free memory on the system than is actually available?

I have a relatively small home Red Hat Linux server (about 8 GB RAM). I don't use it for much other than running some home grown apps to keep track of various things. The only real things running on ...
Aaron K's user avatar
  • 1,525
196 votes
22 answers

Is it normal to get hundreds of break-in attempts per day?

I just checked my server's /var/log/auth.log and found that I'm getting over 500 failed password/break-in attempt notifications per day! My site is small, and its URL is obscure. Is this normal? ...
Kyle Cureau's user avatar
  • 1,537
60 votes
5 answers

iptables port redirect not working for localhost

I want to redirect all traffic from port 443 to the internal port 8080. I'm using this config for iptables: iptables -t nat -I PREROUTING --source 0/0 --destination 0/0 -p tcp \ --dport 443 -...
Chris's user avatar
  • 601
72 votes
2 answers

Why is it so difficult to upgrade between major versions of Red Hat and CentOS?

"Can we upgrade our existing production EL5 servers to EL6?" A simple-sounding request from two customers with completely different environments prompted my usual best-practices answer of "yes, but ...
ewwhite's user avatar
  • 198k
49 votes
3 answers

systemd: Grant an unprivileged user permission to alter one specific service

I'm running a private game server on a headless linux box. Because I'm not an idiot, said server is running as its own unprivileged user with the bare minimum access rights it needs to download ...
Shadur's user avatar
  • 1,357
44 votes
4 answers

Find out which process is changing a file

I'm trying to find a reliable way of finding which process on my machine is changing a configuration file (/etc/hosts to be specific). I know I can use lsof /etc/hosts to find out what processes ...
robbles's user avatar
  • 543
12 votes
3 answers

FTP and Apache permission issues

Im having issues as to which user should own my www directory - ftp or apache? When set to the ftp user, the user can add, remoe and easily modify files but php file system actions generate permission ...
kehers's user avatar
  • 351
110 votes
9 answers

Allow SFTP but disallow SSH?

I'm starting a very little hosting company for a few friends and little clients, nothing big. I want to give my "clients" the right to manage their files on the server. I hate FTP as it is not secure ...
Tommy B.'s user avatar
  • 1,423
104 votes
6 answers

How to force nginx to resolve DNS (of a dynamic hostname) everytime when doing proxy_pass?

I am using nginx/0.7.68, running on CentOS, with the following configuration: server { listen 80; server_name ***; index index.html index.htm index.php default.html default.htm ...
xiamx's user avatar
  • 1,232
85 votes
12 answers

What solutions exist to allow the use of revision control for server configuration files? [closed]

In an environment with multiple system administrators, I see a few advantages to adding the server config files into a revision control system. Most notable are the ability to track changes, who made ...
Dave K's user avatar
  • 2,751
85 votes
5 answers

How do I redirect subdomains to a different port on the same server?

I have some subdomains I want to redirect to specific ports on the same server. Say I have I want to transparently redirect to and I want to ...
user avatar
48 votes
7 answers

How can I identify which processes are generating UDP traffic on Linux?

My machine is continously making udp dns traffic request. what i need to know is the PID of the process generating this traffic. The normal way in TCP connection is to use netstat/lsof and get the ...
boos's user avatar
  • 641
45 votes
13 answers

How to change "From:" field for emails from Cron?

I use remote SMTP via nullmailer and it requires set From field to the specific name, but cron set it as [email protected]. How could I change it to something like [email protected]?
Alexander Artemenko's user avatar
27 votes
8 answers

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 the only directory it's started going through is /bin. I'm afraid to do anything else. ...
Will's user avatar
  • 441
362 votes
5 answers

Anyone else experiencing high rates of Linux server crashes during a leap second day?

*NOTE: if your server still has issues due to confused kernels, and you can't reboot - the simplest solution proposed with gnu date installed on your system is: date -s now. This will reset the ...
Bron Gondwana's user avatar
262 votes
11 answers

How can I run Debian stable but install some packages from testing?

Say you're running a server and you don't want to upgrade to Testing (Squeeze) from Stable (Lenny) to just install a required package or two. What's the best way of installing only certain packages ...
Gareth's user avatar
  • 8,573
69 votes
12 answers

Exchange server replacement that runs on Linux

I've worked as a sysadmin for some years and what I keep coming back to is that users like Microsoft Outlook and want to use its Exchange features. I have tried my fair share of commercial ...
Andrioid's user avatar
  • 2,700
47 votes
14 answers

VMware Linux Server -- how can you tell if you are a vm or real hardware?

An interesting question. I have logged into a Linux (most likely SuSE) host. Is there some way that I can tell programmatically that I am a VM host or not? Also assume that the vmtools are not ...
mdpc's user avatar
  • 11.9k
43 votes
8 answers

Avoid linux out-of-memory application teardown

I'm finding that on occasion my Linux box runs out of memory and it starts tearing down random processes to deal with it. I'm curious what administrators do to avoid this? Is the only real ...
Eddie Parker's user avatar
7 votes
5 answers

ssh delay when connecting

When connecting to one specific server (running Debian Lenny) it always takes about 5 seconds before it prompts me to enter a password. After login there is no noticable delay anymore. There is also ...
user avatar
591 votes
4 answers

What exactly do the colors in htop status bars mean?

By default, htop shows colored status bars for processors, memory, and swap. From left to right, the bars are colored green, blue, yellow, and red depending on some thresholds. What does it mean when ...
tobym's user avatar
  • 6,361
190 votes
4 answers

Should I quit using Ifconfig?

With the servers that mount Infiniband cards, when I use the ifconfig command, I get this warning: Ifconfig uses the ioctl access method to get the full address information, which limits hardware ...
Zhen's user avatar
  • 2,159
121 votes
7 answers

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
Mike B's user avatar
  • 11.9k
108 votes
3 answers

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 ...
fregas's user avatar
  • 1,231
62 votes
18 answers

iptables Tips & Tricks [closed]

I'm sure Linux sysadmins are quite familiar with iptables, the userland interface to the netfilter packet-filtering framework. Now, this "Question" is meant to be a Community Wiki for collecting ...
58 votes
10 answers

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 ...
Agvorth's user avatar
  • 2,459
54 votes
1 answer

iptables forwarding between two interface

So I have a linux box with two wireless interfaces, one is a station and the other an AP. wlan0 (station) - Connected to the internet connection wlan1 (AP) - Other clients connect to it. I would ...
broody's user avatar
  • 653
41 votes
8 answers

Force local IP traffic to an external interface

I have a machine with several interfaces that I can configure as I want, for instance: eth1: eth2: I would like to forward all the traffic sent to one of these local ...
calandoa's user avatar
  • 1,295
38 votes
8 answers

What tool do you recommend to track changes on a Linux/Unix server

I manage several Linux servers for clients in several roles like email, caching, web serving, filtering, firewalling/routing, and so on. Since I don't own these computers and just provide remote ...
Zoredache's user avatar
  • 131k
32 votes
5 answers

How do I differentiate "fake RAID" from real RAID?

The Ubuntu wiki page on FakeRaid says the following: [A] number of hardware products ... claim to be IDE or SATA RAID controllers... Virtually none of these are true hardware RAID controllers....
cdleary's user avatar
  • 1,755

2 3 4 5