Rotating your SSH keys

Changing your SSH keys from time to time is smart. Especially in the case you lose it or something happens to your laptop/mobile phone/etc, you want from time to time to have a few keys in rotation

For most intents and purposes:

  1. First you SSH in.
    ssh user@hostname
  2. Once you're in
    • Copy paste it via your favourite editor
      $FAV_EDITOR ~/.ssh/authorized_keys
    • You might want to append it from a variable
      $KEY >> ~/.ssh/authorized_keys
    • Many other ways to add your keys, but the file it ends up in is the same .ssh/authorized_keys.

      But who wants to do this manually and copy paste things around, when you can specify your identity with a very nice script that's seriously underused:

      ssh-copy-id -i ~/.ssh/newkey user@hostname

This will automatically SSH into the host and put(append) the public key identity in your authorized_keys file.


Don't forget to remove your older and no longer used or compromised SSH keys from the very same file.

That's it!
Happy SSHing.

Fixing nginx 413 Request Entity Too Large

The Problem and the solution

Set up a new website, domain and all, nginx is up and running. Users try to use your website and all of a sudden, your users see a 413 Request Entity Too Large error!

By default, nginx has this at 1 megabyte, which if you're running anything that involved uploading any files, especially videos or high res pictures, it just won't do.

There are several ways to go about fixing this and several values this directive will accept:

Read more "Fixing nginx 413 Request Entity Too Large"