All Questions

Filter by
Sorted by
Tagged with
2484 votes
31 answers

Our security auditor is an idiot. How do I give him the information he wants?

A security auditor for our servers has demanded the following within two weeks: A list of current usernames and plain-text passwords for all user accounts on all servers A list of all password ...
user avatar
1799 votes
3 answers

What is a Pem file and how does it differ from other OpenSSL Generated Key File Formats?

I am responsible for maintaining two Debian servers. Every time I have to do anything with security certificates, I Google for tutorials and beat away until it finally works. However, in my searches ...
Noah Goodrich's user avatar
1419 votes
39 answers

How can I sort du -h output by size

I need to get a list of human readable du output. However, du does not have a "sort by size" option, and piping to sort doesn't work with the human readable flag. For example, running: du | sort -...
Tom Feiner's user avatar
  • 17.6k
984 votes
15 answers

How to determine if a bash variable is empty?

What is the best way to determine if a variable in bash is empty ("")? I have heard that it is recommended that I do if [ "x$variable" = "x" ] Is that the correct way? (there must be something more ...
Brent 's user avatar
  • 22.9k
809 votes
18 answers

Ping a Specific Port

Just a quick sanity check here. Can you ping a specific port of a machine, and if so, can you provide an example? I'm looking for something like ping ip address portNum.
Davie's user avatar
  • 8,215
782 votes
9 answers

Can scp copy directories recursively?

Currently I can only copy a single .tar file. But how can I copy directories recursively with scp?
kernel's user avatar
  • 8,571
742 votes
9 answers

How to automate SSH login with password?

How to automate SSH login with password? I'm configuring my test VM, so heavy security is not considered. SSH chosen for acceptable security with minimal configuration. ex) echo password | ssh id@...
Eonil's user avatar
  • 10.5k
635 votes
18 answers

How do you find what process is holding a file open in Windows?

One thing that annoys me no end about Windows is the old sharing violation error. Often you can't identify what's holding it open. Usually it's just an editor or explorer just pointing to a relevant ...
cletus's user avatar
  • 10k
631 votes
13 answers

How do I deal with a compromised server?

This is a Canonical Question about Server Security - Responding to Breach Events (Hacking) See Also: Tips for Securing a LAMP Server Reinstall after a Root Compromise? Canonical ...
gunwin's user avatar
  • 6,410
584 votes
3 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,291
568 votes
6 answers

ssh 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/ ...
Robert's user avatar
  • 14.7k
555 votes
32 answers

How do I tell Git for Windows where to find my private RSA key?

My Git setup runs fine on Linux, but when I try to set things up under Windows (using Git for Windows and TortoiseGit), I don't know where to put my private SSH key (or, better still, how to tell ssh ...
binaryorganic's user avatar
552 votes
11 answers

In Nginx, how can I rewrite all http requests to https while maintaining sub-domain?

I want to rewrite all http requests on my web server to be https requests, I started with the following: server { listen 80; location / { rewrite ^(.*)$1 ...
MikeN's user avatar
  • 8,462
547 votes
5 answers

What is the difference between double and single square brackets in bash?

I just wondered what exactly the difference between [[ $STRING != foo ]] and [ $STRING != foo ] is, apart from that the latter is POSIX-compliant, found in sh and the former is an extension found in ...
0x89's user avatar
  • 6,465
496 votes
23 answers

mysqldump throws: Unknown table 'COLUMN_STATISTICS' in information_schema (1109)

Every time I try to make a mysqldump I get the following error: $> mysqldump --single-transaction --host host -u user -p db > db.sql mysqldump: Couldn't execute 'SELECT COLUMN_NAME, ...
manifestor's user avatar
  • 6,179
475 votes
8 answers

How does IPv4 Subnetting Work?

This is a Canonical Question about IPv4 Subnets. Related: How does IPv6 subnetting work and how does it differ from IPv4 subnetting? How does Subnetting Work, and How do you do it by ...
475 votes
5 answers

What's the default superuser username/password for postgres after a new install?

I have just installed postgres 8.4 on Ubuntu 9.10 and it has never asked me to create a superuser. Is there a default superuser and its password? If not, how do I create a new one?
Thierry Lam's user avatar
  • 6,261
466 votes
7 answers

Something is burning in the server room; how can I quickly identify what it is?

The other day, we notice a terrible burning smell coming out of the server room. Long story short, it ended up being one of the battery modules that was burning up in the UPS unit, but it took a good ...
Chad Harrison's user avatar
414 votes
15 answers

Displaying a remote SSL certificate details using CLI tools

In Chrome, clicking on the green HTTPS lock icon opens a window with the certificate details: When I tried the same with cURL, I got only some of the information: $ curl -vvI * ...
Adam Matan's user avatar
  • 13.3k
414 votes
3 answers

How do I change my private key passphrase?

I have an existing public/private key pair. The private key is password protected, and the encryption may be either RSA or DSA. These keys are the kind you generate with ssh-keygen and generally store ...
kch's user avatar
  • 4,612
401 votes
20 answers

How to run a server on port 80 as a normal user on Linux?

I have Googled about a solution for quite some time, but couldn't find an answer. I am on Ubuntu Linux and want to run a server on port 80, but due to security mechanism of Ubuntu, I get the ...
Deepak Mittal's user avatar
387 votes
27 answers

How can I get the size of an Amazon S3 bucket?

I'd like to graph the size (in bytes, and # of items) of an Amazon S3 bucket and am looking for an efficient way to get the data. The s3cmd tools provide a way to get the total file size using s3cmd ...
Garret Heaton's user avatar
382 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
378 votes
21 answers

How do you search for backdoors from the previous IT person?

We all know it happens. A bitter old IT guy leaves a backdoor into the system and network in order to have fun with the new guys and show the company how bad things are without him. I've never ...
Jason Berg's user avatar
  • 19.1k
377 votes
20 answers

Showing total progress in rsync: is it possible?

I have searched for this option already, but have only found solutions that involve custom patching. The fact that it does not show in --help and no more info can be found probably indicates the ...
Aron Rotteveel's user avatar
371 votes
6 answers

How to set environment variable in systemd service?

I have an Arch Linux system with systemd and I've created my own service. The configuration service at /etc/systemd/system/myservice.service looks like this: [Unit] Description=My Daemon [Service] ...
lfagundes's user avatar
  • 3,813
371 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.4k
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
361 votes
18 answers

How do I get the current Unix time in milliseconds in Bash?

How do I get the current Unix time in milliseconds (i.e number of milliseconds since Unix epoch January 1 1970)?
Richard's user avatar
  • 3,892
359 votes
29 answers

How can I use environment variables in Nginx.conf

I have a docker container running Nginx, that links to another docker container. The host name and IP address of the second container is loaded into the Nginx container as environment variables on ...
Hugo Rodger-Brown's user avatar
340 votes
4 answers

What are the functional differences between .profile .bash_profile and .bashrc

What are the functional differences between the .profile, .bash_profile and .bashrc files?
lollercoaster's user avatar
337 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
337 votes
18 answers

Copying a large directory tree locally? cp or rsync?

I have to copy a large directory tree, about 1.8 TB. It's all local. Out of habit I'd use rsync, however I wonder if there's much point, and if I should rather use cp. I'm worried about permissions ...
Amandasaurus's user avatar
  • 31.6k
335 votes
5 answers

How to send ctrl+alt+del using Remote Desktop?

How can I send ctrl+alt+del to a remote computer over Remote Desktop? For example, if I wanted to change the local admin password on a remote PC using a Remote Desktop connection, it would be helpful ...
T. Marshall's user avatar
  • 3,453
318 votes
27 answers

100% uptime for a web application

We received an interesting "requirement" from a client today. They want 100% uptime with off-site failover on a web application. From our web application's viewpoint, this isn't an issue. It was ...
NotMe's user avatar
  • 3,772
312 votes
8 answers

How to bind MySQL server to more than one IP address?

Is there a secret way to bind MySQL to more than one IP address? As far as I can see the bind-address parameter in the my.cnf does not support more than one IP and you can't have it more than once.
BlaM's user avatar
  • 3,906
311 votes
2 answers

Create a public SSH key from the private key?

Let's suppose I have a SSH key, but I've deleted the public key part. I have the private key part. Is there some way I can regenerate the public key part?
Amandasaurus's user avatar
  • 31.6k
308 votes
5 answers

Nginx reverse proxy + URL rewrite

Nginx is running on port 80, and I'm using it to reverse proxy URLs with path /foo to port 3200 this way: location /foo { proxy_pass http://localhost:3200; ...
jeffreyveon's user avatar
  • 3,245
306 votes
14 answers

What's the command-line utility in Windows to do a reverse DNS look-up?

Is there a built-in command line tool that will do reverse DNS look-ups in Windows? I.e., something like <toolname> w.x.y.z => mycomputername I've tried: nslookup: seems to be forward look-...
alastairs's user avatar
  • 3,195
300 votes
4 answers

How do I select which Apache MPM to use?

This is a Canonical Question about selecting the right Apache httpd MPM. I'm a little confused between the different MPMs offered by Apache - 'worker', 'event', 'prefork', etc. What are the major ...
Tiffany Walker's user avatar
295 votes
8 answers

Check if port is open or closed on a Linux server?

How can I check if a port is listening on a Linux server?
James Anderson's user avatar
292 votes
16 answers

How to Unban an IP properly with Fail2Ban

I'm using Fail2Ban on a server and I'm wondering how to unban an IP properly. I know I can work with IPTables directly: iptables -D fail2ban-ssh <number> But is there not a way to do it with ...
psp's user avatar
  • 3,183
287 votes
4 answers

Why do I need Nginx and something like Gunicorn?

I'm looking for an overly simplified answer to the following question. I'm trying to build a foundational understanding of how Nginx works alongside something like Gunicorn. Do I need both Nginx and ...
a.m.'s user avatar
  • 2,975
284 votes
5 answers

What's the difference between IP address and

I know that ~ are the loopback IP addresses for most modern operating systems, and these IP addresses can be used to refer to our own computer. But what's It seems ...
Jichao's user avatar
  • 3,037
284 votes
5 answers

Redirect, Change URLs or Redirect HTTP to HTTPS in Apache - Everything You Ever Wanted to Know About mod_rewrite Rules but Were Afraid to Ask

This is a Canonical Question about Apache's mod_rewrite. Changing a request URL or redirecting users to a different URL than the one they originally requested is done using mod_rewrite. This includes ...
Kyle Brandt's user avatar
  • 83.7k
283 votes
15 answers

Finding out what user Apache is running as?

I want to secure a file upload directory on my server as described beautifully here, but I have one problem before I can follow these instructions. I don't know what user Apache is running as. I've ...
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
280 votes
160 answers

Useful Command-line Commands on Windows

The aim for this Wiki is to promote using a command to open up commonly used applications without having to go through many mouse clicks - thus saving time on monitoring and troubleshooting Windows ...
278 votes
45 answers

What are the obstacles to providing reliable Internet access and Wi-Fi at large tech conferences? [closed]

Every tech conference I've ever been to, and I've been to a lot, has had absolutely abysmal Wi-Fi and Internet access. Sometimes it's the DHCP server running out of addresses. Sometimes the backhaul ...
Joel Spolsky's user avatar
  • 3,686
278 votes
7 answers

command for checking Apache configuration

I'm looking for a command that checks the validity of the config files in Apache server on both Debian and RHEL distros. I need to do this prior to restart, so there will be no downtime.
Sigtran's user avatar
  • 2,883

15 30 50 per page
2 3 4 5