Questions tagged [linux]
Linux is the generic term for a UNIX-like open source operating system based on the Linux kernel.
2,979
questions
389
votes
7
answers
942k
views
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 ...
372
votes
6
answers
568k
views
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/...
45
votes
3
answers
10k
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 ...
175
votes
18
answers
280k
views
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 ...
103
votes
6
answers
24k
views
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?
271
votes
2
answers
86k
views
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)...
217
votes
8
answers
348k
views
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 ...
60
votes
5
answers
43k
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 ...
30
votes
5
answers
14k
views
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, http://www.linuxplanet.com/linuxplanet/tutorials/6553/1/). Right now, though, I'm trying to build something on top of IPv6,...
234
votes
4
answers
182k
views
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 ...
77
votes
3
answers
200k
views
How to handle relative urls correctly with a reverse proxy
I have a reverse proxy setup as follows in Apache:
Server A with address www.example.com/folder is the reverse proxy server.
It maps to: Server B with address test.madeupurl.com
This kind of works....
41
votes
7
answers
57k
views
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%...
202
votes
4
answers
280k
views
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:...
83
votes
16
answers
18k
views
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 ...
145
votes
8
answers
567k
views
How can I port forward with iptables?
I want connections coming in on ppp0 on port 8001 to be routed to 192.168.1.200 on eth0 on port 8080.
I've got these two rules
-A PREROUTING -p tcp -m tcp --dport 8001 -j DNAT --to-destination 192....
108
votes
2
answers
304k
views
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 192.168.12.87 and port 80 will be forwarded to 192.168.12.77 port 80.
How to do this with iptables?
Or
Any other ways to ...
195
votes
6
answers
85k
views
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 ...
53
votes
9
answers
119k
views
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 ...
339
votes
27
answers
544k
views
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 ...
283
votes
13
answers
100k
views
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 ...
9
votes
5
answers
38k
views
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 ...
196
votes
22
answers
110k
views
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? ...
60
votes
5
answers
95k
views
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 -...
72
votes
2
answers
34k
views
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 ...
49
votes
3
answers
81k
views
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 ...
44
votes
4
answers
27k
views
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 ...
12
votes
3
answers
22k
views
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 ...
110
votes
9
answers
139k
views
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 ...
104
votes
6
answers
200k
views
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 ...
85
votes
12
answers
20k
views
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 ...
85
votes
5
answers
187k
views
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
dev.mydomain.com
I want dev.mydomain.com to transparently redirect to mydomain.com:8080 and I want to ...
48
votes
7
answers
74k
views
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 ...
45
votes
13
answers
71k
views
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]?
27
votes
8
answers
7k
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 the only directory it's started going through is /bin.
I'm afraid to do anything else. ...
362
votes
5
answers
154k
views
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 ...
262
votes
11
answers
268k
views
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 ...
69
votes
12
answers
14k
views
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 ...
47
votes
14
answers
103k
views
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 ...
43
votes
8
answers
50k
views
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 ...
7
votes
5
answers
4k
views
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 ...
591
votes
4
answers
333k
views
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 ...
190
votes
4
answers
82k
views
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 ...
121
votes
7
answers
200k
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
108
votes
3
answers
79k
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 ...
62
votes
18
answers
44k
views
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
39k
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
...
54
votes
1
answer
215k
views
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 ...
41
votes
8
answers
88k
views
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: 192.168.1.1
eth2: 192.168.2.2
I would like to forward all the traffic sent to one of these local ...
38
votes
8
answers
22k
views
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 ...
32
votes
5
answers
27k
views
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....