All Questions
322,793
questions
2484
votes
31
answers
541k
views
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 ...
1799
votes
3
answers
2.1m
views
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 ...
1419
votes
39
answers
1.2m
views
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 -...
984
votes
15
answers
1.4m
views
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 ...
809
votes
18
answers
2.8m
views
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.
782
votes
9
answers
1.1m
views
Can scp copy directories recursively?
Currently I can only copy a single .tar file. But how can I copy directories recursively with scp?
742
votes
9
answers
2.3m
views
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@...
635
votes
18
answers
907k
views
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 ...
631
votes
13
answers
163k
views
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 ...
584
votes
3
answers
327k
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 ...
568
votes
6
answers
493k
views
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/
...
555
votes
32
answers
1.1m
views
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 ...
552
votes
11
answers
588k
views
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 ^(.*) https://mysite.com$1 ...
547
votes
5
answers
272k
views
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 ...
496
votes
23
answers
346k
views
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, ...
475
votes
8
answers
184k
views
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
1.2m
views
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?
466
votes
7
answers
77k
views
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 ...
414
votes
15
answers
737k
views
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 https://gnupg.org
* ...
414
votes
3
answers
337k
views
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 ...
401
votes
20
answers
438k
views
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 ...
387
votes
27
answers
459k
views
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 ...
382
votes
7
answers
926k
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 ...
378
votes
21
answers
66k
views
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 ...
377
votes
20
answers
354k
views
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 ...
371
votes
6
answers
622k
views
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]
...
371
votes
6
answers
564k
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/...
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 ...
361
votes
18
answers
581k
views
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)?
359
votes
29
answers
479k
views
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 ...
340
votes
4
answers
165k
views
What are the functional differences between .profile .bash_profile and .bashrc
What are the functional differences between the .profile, .bash_profile and .bashrc files?
337
votes
27
answers
537k
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 ...
337
votes
18
answers
427k
views
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 ...
335
votes
5
answers
890k
views
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 ...
318
votes
27
answers
67k
views
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 ...
312
votes
8
answers
761k
views
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.
311
votes
2
answers
202k
views
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?
308
votes
5
answers
686k
views
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;
...
306
votes
14
answers
984k
views
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-...
300
votes
4
answers
194k
views
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 ...
295
votes
8
answers
1.3m
views
Check if port is open or closed on a Linux server?
How can I check if a port is listening on a Linux server?
292
votes
16
answers
698k
views
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 ...
287
votes
4
answers
116k
views
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 ...
284
votes
5
answers
368k
views
What's the difference between IP address 0.0.0.0 and 127.0.0.1?
I know that 127.0.0.1 ~ 127.255.255.254 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 0.0.0.0? It seems ...
284
votes
5
answers
115k
views
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 ...
283
votes
15
answers
526k
views
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 ...
283
votes
13
answers
99k
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 ...
280
votes
160
answers
317k
views
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
68k
views
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 ...
278
votes
7
answers
658k
views
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.