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

learn more… | top users | synonyms (3)

23
votes
2answers
48k views

How can I allow one user to su to another without allowing root access?

I'd like to allow certain users to su to another user account without having to know that account's password, but not allow access to any other user account (i.e. root). For instance, I'd like to ...
23
votes
12answers
3k views

Storing and backing up 10 million files on Linux

I run a website where about 10 million files (book covers) are stored in 3 levels of subdirectories, ranging [0-f]: 0/0/0/ 0/0/1/ ... f/f/f/ This leads to around 2400 files per directory, which is ...
23
votes
7answers
15k views

Unzipping files that are flying in through a pipe

Can I make unzip or any similar programs work on the standard output? The situation is I'm downloading a zip file, which is supposed to be unzipped on the fly. Related issue: ...
23
votes
1answer
1k views

Why does deleting a big file take longer?

My understanding is that running rm on a file simply unlinks it, marking the space as free in the filesystem. It should then follow that deleting one file always takes roughly the same amount of time ...
23
votes
1answer
9k 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 ...
23
votes
4answers
4k views

Does anyone really understand how HFSC scheduling in Linux/BSD works?

I read the original SIGCOMM '97 PostScript paper about HFSC, it is very technically, but I understand the basic concept. Instead of giving a linear service curve (as with pretty much every other ...
23
votes
1answer
2k views

When using software RAID and LVM on Linux, which IO scheduler and readahead settings are honored?

In the case of multiple layers (physical drives -> md -> dm -> lvm), how do the schedulers, readahead settings, and other disk settings interact? Imagine you have several disks (/dev/sda - /dev/sdd) ...
22
votes
3answers
1k views

What are the actual benefits of assigning sudo privileges to a user instead of using root?

I am fairly new to server administration, and I have seen a lot of sites recommending to assign sudo privileges to a user created by the root user and giving the root user an insanely long password ...
22
votes
13answers
36k 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 ...
22
votes
5answers
5k views

What do these abbreviations stand for?

Some directories are easy to understand the meaning /usr /bin ... But for the next ones, I have no idea. /etc /opt opt for optional? etc for electronic t...... configuration (no idea for t) I ...
22
votes
6answers
43k views

How can I kill all stopped jobs?

When I try to exit from my Linux server I get the message: There are stopped jobs. : Is there a single command to kill these?
22
votes
5answers
2k views

Can a program tell it is being run under sudo?

I have a program that should behave differently if it is being run under "sudo". Is there a way it can find out if it was run under sudo? Update: Someone asked why would I want to do this. In this ...
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 ...
22
votes
7answers
37k views

df in linux not showing correct free space after file removal

I have file servers which are used to store files. Files might reside there for a week, or for a year. Unfortunately, when I remove files from the server, df command doesnt reflect the freed up space, ...
22
votes
7answers
20k views

how can I limit per user bandwidth?

To summarise: I have a dedicated server with a few friends running a torrent client with web gui. Each user is running a client under their username on the server so downloads go in their user dir, ...
22
votes
8answers
2k views

Secure Network Filesystems for Linux: What are people doing?

NFSv3 is widespread, but the default security model is... quaint. CIFS can use Kerberos authentication, but without POSIX semantics it's a non-starter. AFS never did encrypt traffic on the wire and ...
22
votes
8answers
8k views

Setup a linux computer to act as a bluetooth keyboard/mouse [closed]

I want to make my laptop announce itself as a bluetooth keyboard or/and a bluetooth mouse. It would be nice to be able to connect the computer to my phone or my media computer using bluetooth. Does ...
22
votes
5answers
20k views

How passively monitor for tcp packet loss? (Linux)

How can I passively monitor the packet loss on TCP connections to/from my machine? Basically, I'd like a tool that sits in the background and watches TCP ack/nak/re-transmits to generate a report on ...
21
votes
10answers
4k views

I just did a chmod -x chmod

So I did a chmod -x chmod. How I can fix this problem? How do I give execute rights back to chmod?
21
votes
8answers
4k views

How to hide a password passed as command line argument?

I'm running a software daemon that requires for certain actions to enter a passphrase to unlock some features which looks for example like that: $ darkcoind masternode start <mypassphrase> ...
21
votes
5answers
37k views

Filename length limits on linux?

Are there any filename or path length limits on Linux?
21
votes
6answers
23k views

How to tell what process has a specific port open on Linux?

I ran nmap on my server and found a strange port open. I'm trying to figure out if there is a way to map that port to a specific process but have no idea if there is such a tool. Any suggestions?
21
votes
4answers
4k views

In tail -f, how do I filter out stuff that has certain keywords?

I want to tail -f my logs. However, I want to filter out everything that has the words: "ELB", "Pingdom", "Health"
21
votes
4answers
13k views

How to add message that will be read with dmesg?

I am trying to write some custom messages in my dmesg output. I tried: logger "Hello" but this does not work. It exits without error, but no "Hello" appears int the output of: dmesg I am using a ...
21
votes
9answers
60k 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 ...
21
votes
18answers
21k 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 ...
21
votes
4answers
9k 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
21
votes
6answers
78k views

add new user with root access in Linux

I want to add new user and have/grant that new user to have all the root access, how can I do that ? I did sudo adduser --system testuser but this is not working as I expected. Thanks for help.
21
votes
10answers
18k views

How to make `rm` faster on ext3/linux?

I have ext3 filesystem mounted with default options. On it I have some ~ 100GB files. Removal of any of such files takes long time (8 minutes) and causes a lot of io traffic, which increases load on ...
21
votes
4answers
17k views

How to sort ps output by process start time?

Is there a way to sort ps output by process start time, so newest are either at the top or bottom ? On Linux ? On SysV5 ? On Mac ?
21
votes
6answers
20k views

What happens if I delete lost+found

When you create some Linux filesystems like ext3 a 'lost+found' directory is created. According to this files will be placed there if files were damaged from some kind of system crash. What happens ...
21
votes
2answers
11k 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?
21
votes
11answers
31k views

Linux clients for Exchange (email and) calendar [closed]

At $work, the official email solution is Outlook on Windows, connected to an Exchange server. That's problematic for people with Linux on their desktop machine. The Exchange server supports IMAP, and ...
21
votes
1answer
342 views

Is there a device file that just blocks?

... something similar to /dev/null, but that just blocks all bytes that are written to it? What I need is a trick to hold an arbitrary executable in memory by blocking its output. Pipes don't seem ...
21
votes
5answers
15k views

swap partition vs file for performance?

What is better for performance? A partition closer to the inside of the disk will have slower access times, and we must wait for the drive to switch between the OS and swap partitions. On the other ...
20
votes
7answers
2k views

Restrict a Linux user to the files he owns

Imagine a server setup of a shared webhosting company where multiple (~100) customers have shell access to a single server. A lot of web "software" recommends to chmod files 0777. I'm nervous about ...
20
votes
9answers
1k views

Toolkit & Habits for Linux Network & System Administration [closed]

I am tasked with the administration of a small office network as well as several workstations running mostly Debian and Ubuntu. There are two servers: one database & print-server, and one backup ...
20
votes
5answers
15k 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 ...
20
votes
5answers
3k views

A domain I've never heard of resolves to my website [duplicate]

I've discovered (via looking at mod_pagespeed cache entries) that a completely random domain I've never heard of before is resolving to my website. If I visit this domain, my website loads. The DNS ...
20
votes
5answers
41k 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 ...
20
votes
2answers
15k 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 ...
20
votes
1answer
654 views

Why does sshd(openssh) create two processes per connection?

before login: $ ps -elf | grep sshd 5 S root 26135 1 0 80 0 - 13115 ? 17:26 ? 00:00:00 /usr/sbin/sshd 0 S test 26480 21337 0 80 0 - 4154 - 18:41 pts/27 ...
20
votes
1answer
9k views

ssh hostname returns “Bad owner or permissions on ~/.ssh/config”

When I try to ssh to another box, I get this strange error $ ssh hostname Bad owner or permissions on ~/.ssh/config But I made sure that I own and have rw permissions on the file: ls -la ~/.ssh/ ...
20
votes
4answers
2k views

Can MySQL effectively take advantage of 64 GB RAM?

We have been running into a problem where querying a table that has approximately 50 million rows, and has an index size of 4 GB (table size of about 6 GB) results in the database server swapping ...
20
votes
3answers
20k views

Why is my rsync so slow?

My Laptop and my workstation are both connected to a Gigabit Switch. Both are running Linux. But when I copy files with rsync, it performs badly. I get about 22 MB/s. Shouldn't I theoretically get ...
20
votes
1answer
2k views

How can I block all traffic *except* Tor?

On a Linux system, is there a way to block all in and outbound traffic unless it passes through the Tor network. This includes any form of IP communication, not just TCP connections. For example I ...
20
votes
6answers
466 views

How to find out which Linux distribution I'm logged on to

Is there a command for finding out the distribution of the OS I'm logged on to through SSH? uname can be used to print a whole lot of info, but apparently not the distribution (e.g. RedHat, Ubuntu ...
20
votes
4answers
18k views

With what tool should I format a hard drive as UDF?

(This is a follow-up to "What is the partition id / filesystem type for UDF?") I know two ways to format a hard drive as UDF: Windows Vista or later: "format x: /fs:UDF" (don't use /q ! ) Linux: ...
20
votes
10answers
2k views

How to track superuser activities

I'd like to know what are the best approaches for tracking superuser activities on a Linux environment. Specifically, I'm looking for these features: A) Logging keystrokes to a secured syslog ...
20
votes
6answers
8k views

Verify TRIM support with BtrFS on SSD

We are looking into using BtrFS on an array of SSD disks and I have been asked to verify that BtrFS does in fact perform TRIM operations upon deleting a file. So far I have been unable to verify that ...