Most Popular

1500 questions
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 changes for the past six months, again in plain-text A…
  • 24,039
  • 15
  • 57
  • 76
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 I often come across different file formats (.key,…
Noah Goodrich
  • 18,677
  • 6
  • 24
  • 16
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 -n -r Outputs a sorted disk usage by size…
Tom Feiner
  • 16,758
  • 8
  • 29
  • 24
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 straightforward)
  • 22,219
  • 19
  • 68
  • 102
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.
  • 8,055
  • 3
  • 11
  • 8
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?
  • 8,211
  • 5
  • 18
  • 14
10 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@server This doesn't work. I remember I did this with…
  • 9,689
  • 15
  • 34
  • 53
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 Version I suspect that one or more of my servers is compromised…
  • 6,330
  • 3
  • 18
  • 22
16 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 directory but sometimes I've had to resort to…
  • 9,779
  • 9
  • 36
  • 40
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 the Memory bar has a small level of green and…
  • 6,011
  • 3
  • 16
  • 9
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/ total 40K drwx------ 2 robert robert 4.0K Mar 29…
  • 14,423
  • 4
  • 18
  • 14
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 permanent; } ... One Problem is that this…
  • 8,252
  • 5
  • 22
  • 18
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 where it's located). I'm using the standard…
  • 5,901
  • 4
  • 17
  • 19
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 bash.
  • 6,345
  • 3
  • 21
  • 14
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 hand or in your head? Can someone explain both conceptually…
Kyle Brandt
  • 82,107
  • 71
  • 302
  • 444
2 3
99 100