All Questions
325,299
questions
2493
votes
31
answers
555k
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 ...
1829
votes
3
answers
2.2m
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 ...
1459
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 -...
1014
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 ...
815
votes
18
answers
2.9m
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.
791
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?
749
votes
8
answers
2.4m
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@...
642
votes
18
answers
941k
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 ...
632
votes
13
answers
166k
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 ...
598
votes
4
answers
345k
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 ...
569
votes
6
answers
499k
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/
...
558
votes
33
answers
1.2m
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 ...
554
votes
11
answers
601k
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
275k
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 ...
503
votes
23
answers
359k
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, ...
481
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?
476
votes
8
answers
188k
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 ...
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 ...
431
votes
15
answers
798k
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
* ...
421
votes
3
answers
350k
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 ...
404
votes
20
answers
452k
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 ...
395
votes
7
answers
970k
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 ...
393
votes
27
answers
477k
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 ...
384
votes
20
answers
369k
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 ...
379
votes
6
answers
676k
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]
...
378
votes
22
answers
67k
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 ...
374
votes
30
answers
510k
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 ...
373
votes
6
answers
577k
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/...
370
votes
19
answers
603k
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)?
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 ...
343
votes
27
answers
560k
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 ...
342
votes
5
answers
907k
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 ...
342
votes
4
answers
169k
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?
339
votes
18
answers
440k
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 ...
325
votes
2
answers
229k
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?
319
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 ...
313
votes
5
answers
723k
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;
...
313
votes
8
answers
786k
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.
310
votes
14
answers
1.0m
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-...
305
votes
8
answers
1.4m
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?
304
votes
17
answers
735k
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 ...
300
votes
4
answers
198k
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 ...
291
votes
4
answers
120k
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 ...
288
votes
15
answers
542k
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 ...
286
votes
5
answers
379k
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 ...
285
votes
5
answers
116k
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 ...
284
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 ...
283
votes
7
answers
711k
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.
280
votes
160
answers
319k
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 ...
280
votes
4
answers
277k
views
How to remove an image tag in Docker without removing the image itself?
Let's say I want to tag a Docker image, and make a typo. How do I remove the tag without removing the image itself? Neither the manpages nor the Docker documentation mention removing tags.
docker tag ...