Hot answers tagged

225 votes

How to view all ssl certificates in a bundle?

http://comments.gmane.org/gmane.comp.encryption.openssl.user/43587 suggests this one-liner: openssl crl2pkcs7 -nocrl -certfile CHAINED.pem | openssl pkcs7 -print_certs -text -noout It indeed worked ...
149 votes
Accepted

How do I auto-start docker containers at system boot?

Apparently, the current method to auto-start Docker containers (from Docker 1.2) is to use restart policies. This will control how Docker should handle starting of the container upon startup and re-...
user avatar
  • 2,085
117 votes

dpkg-reconfigure: unable to re-open stdin: No file or directory

I got the error message to go away by putting the following in my provisioning script, prior to any apt-get calls: export DEBIAN_FRONTEND=noninteractive This makes debconf use a frontend that ...
user avatar
  • 1,271
104 votes

Apache2 config variable is not defined

Source your envvars by running it like this: source /etc/apache2/envvars and then /usr/sbin/apache2 -V You should get: el@apollo:/home/el$ apache2 -V Server version: Apache/2.4.7 (Ubuntu) Server ...
user avatar
  • 1,469
104 votes
Accepted

Can you run Docker natively on the new Windows 10 (Ubuntu) bash userspace?

You can use Docker Desktop for Windows as the engine and Docker for Linux as the client in WSL on Ubuntu / Debian on Windows. Connect them via TCP. Install Docker Desktop for Windows: https://hub....
user avatar
103 votes

How can I check /dev/xvda1?

For our ec2 ubuntu instance, the above answers did not work completely. On Ubuntu, by default, the check is not enabled in the rcS file. So Edit rcS file sudo vi /etc/default/rcS below the line #...
user avatar
90 votes

Command line program to test DHCP service

Based on this answer, assuming you have installed nmap (sudo apt install nmap): sudo nmap --script broadcast-dhcp-discover Add the -e $interface option if you have more than one network interface. (...
user avatar
  • 3,386
90 votes
Accepted

How do I get apt-get to ignore some dependencies?

Simple and easy solution: just specify the unwanted packages with an extra - after each of them. Example without the - switch: root@debian:~# apt-get install bsd-mailx Reading package lists... Done ...
user avatar
  • 1,026
88 votes
Accepted

What does -qq argument for apt-get mean?

The -qq is a flag to apt-get to make it less noisy. -qq No output except for errors You are correct about the >/dev/null. By redirecting all the STDOUT, the -qq becomes redundant.
user avatar
  • 2,442
86 votes
Accepted

Docker containers can't resolve DNS on Ubuntu 14.04 Desktop Host

Woo, I found a post on github that solved my problem. After Steve K. pointed out that it wasn't actually a DNS issue and was a connectivity issue, I was able to find a post on github that described ...
user avatar
  • 1,981
75 votes
Accepted

debian packages version convention

The Debian Policy Manual has this to say about the version field, which answers some parts of your question: Format The format is: [epoch:]upstream_version[-debian_revision] The three ...
user avatar
  • 7,658
73 votes

Amazon Linux vs. Ubuntu for Amazon EC2

Amazon Linux is a rolling distro, like Fedora, or Debian Testing (sort of). In my view it is not suitable for any production product whatsoever. I'm surprised more people do not realize this. This ...
user avatar
  • 843
73 votes
Accepted

Straight forward way to run ssh-agent and ssh-add on login via SSH?

You can try adding this: eval $(ssh-agent -s) ssh-add ~/.ssh/id_rsa This way the ssh-agent does not start a new shell, it just launches itself in the background and spits out the shell commands to ...
user avatar
  • 1,752
62 votes

Difference in sites-available vs sites-enabled vs conf.d directories (Nginx)?

I would like to add to the previous answers that the most important is not how you call the directories (though that is a very useful convention), but what you actually put in nginx.conf. Example ...
user avatar
61 votes

Locked out of my own server: getting "Too many authentication failures" right away when connecting via ssh

This error usually means that you’ve got too many keys loaded in your ssh-agent. Explanation: Your ssh client will attempt to use all the keys from ssh-agent one by one before it gets to use the key ...
user avatar
  • 23.7k
59 votes

How do you set a locale non-interactively on Debian/Ubuntu?

Could not get @stone's answer to work. Instead, I use this method (for Dockerfiles): # Configure timezone and locale echo "Europe/Oslo" > /etc/timezone && \ dpkg-reconfigure -f ...
user avatar
  • 591
59 votes
Accepted

Can't enter the letter 'e' over ssh

My problem is not the same as can't type lower cased e in amazon ec2 (Amazon Linux), but similar. After checking /etc/inputrc and finding nothing out of the ordinary, I remembered that I did do ...
user avatar
  • 4,122
58 votes
Accepted

What is the difference between PV and HVM virtualization types in ec2?

Amazon run on Xen, which provides Para-virtualization (PV) or Hardware-assisted virtualization (HVM). Para-virtualization used to be the recommended choice, as it gave you better performance (with a ...
user avatar
  • 19.5k
57 votes

UFW Firewall Rules ordering?

If you're interested in reordering your UFW rules, this is one way to do it. $ sudo ufw status numbered To Action From -- ------ --...
user avatar
57 votes

Difference in sites-available vs sites-enabled vs conf.d directories (Nginx)?

What's Going On? You must be using Debian or Ubuntu, since the evil sites-available / sites-enabled logic is not used by the upstream packaging of nginx from http://nginx.org/packages/. In either case,...
user avatar
  • 12.8k
54 votes

Deleting All Partitions From the Command Line

The wipefs program lets you easily delete the partition-table signature: wipefs -a /dev/sda From man wipefs wipefs can erase filesystem, raid or partition-table signatures (magic strings) from ...
user avatar
54 votes
Accepted

How do I find out where the web site's code resides?

First of all you should check what websites are hosted on the server # apachectl -t -D DUMP_VHOSTS Then when you will find a site check corresponding configuration file for the option DocumentRoot. ...
user avatar
  • 7,015
51 votes
Accepted

Failed tls handshake. Does not contain any IP SANs

... Failed to tls handshake with 192.168.2.107 x509: cannot validate certificate for 192.168.2.107 because it doesn't contain any IP SANs SSL needs identification of the peer, otherwise your ...
user avatar
51 votes
Accepted

How can I check /dev/xvda1?

Most Linuxes these days should perform a forced fsck at boot time when the file /forcefsck is present on the system. If you are at liberty to reboot the VM, run touch /forcefsck Then reboot at ...
user avatar
  • 1,823
51 votes

Can you run Docker natively on the new Windows 10 (Ubuntu) bash userspace?

As of right now (April 2016) the answer is: We do not know yet (but probably not). The facts Windows 10 can now run a variety of Linux programs (among them the Bash shell and various text utilities)...
user avatar
  • 9,801
49 votes

Can I hide all server / os info?

If you have installed nginx using apt-get in Debian or Ubuntu, you might need to install the package nginx-extras to set or clear "Server" header Once this is done, you can add the lines below in ...
user avatar
49 votes

How do I rename a Linux host without needing to reboot for the rename to take effect?

You can change the kernel's idea of the hostname on a systemd-based system using the hostnamectl tool. For example: hostnamectl set-hostname whatever You can view the system's current idea of the ...
user avatar
48 votes
Accepted

How do I check if Log4j is installed on my server?

Try this script to get a hint: echo "checking for log4j vulnerability..." OUTPUT="$(locate log4j|grep -v log4js)" if [ "$OUTPUT" ]; then echo "[WARNING] maybe ...
user avatar
  • 2,272
47 votes

Best location to keep SSL certificates and private keys on Ubuntu servers?

It really doesn't matter where you put them as long as you properly protect your private key file(s). The public certificate is public; no protection needed - server privileges or otherwise. To expand ...
user avatar
  • 959
47 votes
Accepted

How To Tune Apache on Ubuntu 14.04 Server

Recognize that Ubuntu 14.04 uses Apache 2 with PHP running through an mpm_prefork module, of which an editable file is in /etc/apache2/mods-enabled/mpm_prefork.conf. Also, recognize that starting in ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible