Creating ssh keys for password-less sign on to remote systems

Below is the process required for setting up password-free sign in for “user” at a server called “”. I’ve added links to “Explain Shell” throughout so you can see an overview of what the commands and arguments do.

First, create your .ssh directory by issuing the command mkdir -m 700 -p ~/.ssh.

Secondly create the keypair: ssh-keygen -t rsa -b 2048 -f ~/.ssh/ The filename ( can be anything you want, but it’s easiest to use a name that hints at for what server you’ve generated the keys.

You’ll be prompted for a passphrase for the key. This isn’t required, but is recommended. You can generate and store your passphrase in your OS’s keychain manager. The Mac has Keychain. Linux offers KWallet or Seahorse. You can also use a password manager like 1Password. Keep in mind, though, that using a password manager will likely negate the “passwordless” bit of the process unless it has the kind of OS integration the aforementioned keychain managers have.

You’ll now have two key files in ~/.ssh: a private key called and a public key called

Next, you need to add the public key to the remote server to which you’d like to sign in. To do that, use the script ssh-copy-id. If you’re on a Mac, you need to first get that script via homebrew. Install brew, then run brew install ssh-copy-id.

Push the key up to by issuing the command ssh-copy-id -i ~/.ssh/ When prompted for a password, use the password you normally use to sign on to the system, not your key’s passphrase.

The sign into the remote system using the new keypair, use the command ssh -i ~/.ssh/ The first time you do so, your OS will prompt you for the passphrase. Enter it, and allow your OS to save the passphrase to the keychain for passwordless log in.

Once the credentials have been added to the remote system, it’s handy to add the host, user, and key to your ssh config. Detailed instructions can be found on Nerderati.

Archiving Sent Mail with imapfilter

My “sent” folders are a morass. I think that’s true of most folks. I wrote a little script in my imapfilter config.lua to duplicate some handy functionality from the venerable pine. I’m sure it could be cleaned up a bit, but it does the job for me. On the first of the month, it creates a folder called “Sent-Monthname-Year”, and moves everything from sent that’s older than a day to it.

function moveSentMessages()
  -- On the first of the month  --
  -- move all older messages to --
  -- a date marked sent folder  --

  theDate ="*t")

  months = {

  if (theDate["day"] == 1) then
    dateString = "Sent-" .. months[theDate["month"] - 1] .. "-" .. theDate["year"]
    messages = personal["Sent"]:is_older(1) + personal["Sent Messages"]:is_older(1)

Quickly adding a link to the iOS Simulator

I was looking for a way to easily add a link to the iOS Simulator in my ~/Applications folder, but every explanation that worked for Mavericks seemed unnecessarily complicated to me. Here’s what I figured out myself:

  1. Open Xcode and launch the simulator as normal
  2. Control-click on the simulator icon in the dock, and select Options → Show in Finder
  3. Open a terminal, and type ln -s
  4. Drag the simulator icon to the terminal window
  5. Drag the destination for the link to the terminal window, and hit Enter