SSH Login Without Entering A Password

I tire of constantly entering my password everytime I need to login to a machine. Now that I have a system for keeping track of my passwords I no longer feel like I need to use them constantly for memory purposes. So here’s the info that I use to log in to other machines through ssh without needing to enter a password each time. This is very handy for allowing scripts to access other machines to automate your tasks. Without futher ado here’s how to allow an automatic login from host A / user a to Host B / user b.

How to do it

First log in on A as user a and generate a pair of authentication keys. Do not enter a passphrase:

a@A:~> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/a/.ssh/id_rsa):
Created directory '/home/a/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/a/.ssh/id_rsa.
Your public key has been saved in /home/a/.ssh/id_rsa.pub.
The key fingerprint is:
3e:4f:05:79:3a:9f:96:7c:3b:ad:e9:58:37:bc:37:e4 a@A

Now use ssh to create a directory ~/.ssh as user b on B. (The directory may already exist, which is fine):

a@A:~> ssh b@B mkdir -p .ssh
b@B's password:

Finally append a’s new public key to b@B:.ssh/authorized_keys and enter b’s password one last time:

a@A:~> cat .ssh/id_rsa.pub | ssh b@B 'cat >> .ssh/authorized_keys'
b@B's password:

From now on you can log into B as b from A as a without password:

a@A:~> ssh b@B hostname
B

This post is a summarized version of a post on how to login through ssh without a password, copied here for long term memory purposes :)

Posted in linux | No Comments »

New Years Resolutions 2010

January 2nd, 2010

Last year turned out to be a great year for building new habits. I’ve made good progress on two. And while they weren’t New Years Resolutions they were things that I decided I’d like to change.

So the fruit of last year amounts to my now being a regular flosser (not everyday, but regular) and no longer maintaining a pile of clothes beside my bed. This year I’m hoping to continue making some positive changes, with these two slightly more general ( but still very important goals).

- daily excercise for mind, body and soul
- making decisions and taking action as soon as I can

It’s time for a change. Joanna and I have been living in the Dingley Dell apartment for the last three years (ever since we first got married!). It’s been a great place, lots of light, lots of good time here and the unforgettable name, Dingley Dell (and all its associated rhyming pseudonyms). But the time has come for us to move on.

And move on we will, about 1.7 kms North West to Garthland.

View Larger Map
So you wouldn’t call this a big move exactly, at least not in distance, but it is going to be a big move for us as this is going to be the first house that we own! We’re pretty excited.

I’m very excited to have a garden AND a place to put some tools, that doesn’t look like one of the cupboards in the office desk. It’s a nice property with an arbutus out front and some Garry Oaks out back. I’m going to have to re-acquaint myself with a lawn mower, but I’m looking forward to being able to get back into doing that kind of work. Lately, the only time I get to do outside work is when I get up to Hardwicke, which is great, but I’m looking forward to having my own place to put some of my pent-up crazy ideas into action.

So without further ado, here’s a picture of what to look for if you come and visit. And if you know someone who is looking for a two bedroom suite to rent in January… let me know!
904 Garthland

My presentation from this WordCamp Victoria this weekend!

Posted in Internet | No Comments »

Small Venues, Small Crowds

October 31st, 2009

I enjoy seeing bands, sports and really pretty much any event in a small venue and with a reasonably small crowd.  The warmth and closeness that you can have in a small venue is just awesome.  It makes the show come alive in a way that the big shows (at least the ones I’ve been to) can’t seem to match.

Concerts

Elliot Brood, The Ticket

Concerts are one of my favourites. I love the music, I love the rhythm, I love the chance to dance (although I am occasionally a somewhat reluctant dancer). And I’ve been to a number of large concerts in stadiums and outdoor stages. And so far, I’m still loving the small venue with it’s less popular band over a large venue and a wildly popular band. The conversation that a band and crowd can carry out in a smaller venue is awesome. The band stirs the crowd up, and the crowd starts giving the energy back to the band and soon, it is one awesome collective experience.

2009-10-31

Amateur Sports

Going to the game live is pretty neat because you have the chance to be in the atmosphere and I’m certainly not saying the watching an event on TV is any substitue in the atmosphere department. But I will say that when it comes down to just seeing what is happening during the game you’re almost always better to watch on TV, unless you can get tickets right up front (or go to a game where the crowd is small enough that pretty much all the tickets give you a spot that is right up front.

In both cases, whether an sporting event or a concert, the atmosphere is the reason to go and see it live.  And for my money it seems I enjoy going to twice as many small events and spending the same money as I would on one big event.

Supporting Where It Counts

The last great thing that going to smaller local shows and sporting events does, is support the events that really need support.  The band that tours across Canada hitting all the little cities, they need your support to keep going!  The local team that is playing week in and week out in the local college gym, they need you to get in there and buy hot dogs so they can keep playing! Your contribution to what they’re doing is notice-able and significant.

Big Names and Watching Success Grow

There’s no way around it.   If you’re into supporting smaller shows, smaller venues, amateur teams, you aren’t going to be seeing the big names play.  There’s just no two ways about it.  I think this is something that the local supporter just has to come to terms with.

Equally troubling is watching a band/team/player grow from a small venue to the point of popularity that they can no longer play small venues. If/when someone does make it big who you supported through the course of their success they reach the point that the small venue supporter probably won’t go any longer. It’s kind of a sad time, a parting of company although one can always go to the big shows. It just won’t be the same. And at that point, perhaps there is nothing left to do but reflect back on those first shows and enjoy the memories. In some ways being a small venue support you get to be involved in the growth of the group/team and that may be a reward all it’s own.

Addendum: One totally awesome thing about going to smaller shows is how much more accessible the players or musicians are.  Chances of meeting a performer at a small show? 1:1 large show? 1:100, maybe worse!

Posted in Thoughts | No Comments »

After reading the Omnivore’s Dilemna last year on my triup out to Halifax around this time last year I thought it was probably time to dive into another book on food.  I figure one a year is about the right pace for me.  Although after reading this book there were a few times where I figured that I should probably give up reading about food, outside of just getting a really cook books and going to work learning the dishes and techniques from yester-years cooking.

41gMl1amRUL._SL160_In Defense of Food is a really interesting look at what nine tenths of the food in the grocery store is today and how we’ve been encouraged to give up the age old habit of cooking with raw food in favour of just warming up some pre-prepared meals in the microwave and calling it dinner. One of the central tenets of the book is that when reductionist science got applied to the food we eat, they succeeded in breaking it down into a series of bits and pieces called Nutrients and everyone was really happy. Because you could focus on the nutrients and there were guidelines that indicted that if you just got the correct amount of nutrients and you would be healthy.  Unfortunately, the first pass of reductionist science missed spotting that viatmins were an important part of ones diet, and consequently some of the initial experiments with food science had some pretty bad results.  How bad? Try baby food without vitamins.  That’s not good.

The book moves on to highlight a short history of nutritionist thought since it’s inception.  How the sweeping tide of current nutrionist science has painted one nutrient the bad guy and then shifted focus to another in the hopes of getting closer to keeping us healthy and in the consequently, helping creating processed food that does in fact make us healthy.  There’s definitely a link being drawn between, the people creating processed food and the folks who are doing the studies to determine what is healthy.  If I understood correctly, one of the points which Pollan strives to make is that the science’s understanding of what makes a body healthy is incomplete and the body has worked long and hard to deal effectively with the diet that had developed over centuries before we started processing food and breaking down and remodelling our foods after the current desires and fashions.  In the face of this incomplete understanding of food and how it interacts with our bodies we are better off to trust in the food culture that has been developed over the centuries.

In Defense of Food turns it’s eyes towards practical tips for what we should be eating.  The short version of the punch line is written on the cover of the book. “Eat Food, Not Too Much. Mostly Plants”  Then goes on to list a bunch of tips for how one might do this.  Most of the tips are pretty simple, like shopping around the outside of the grocery store, actually taking the time to cook food and eating slowly.  The tips serve as good reminders for what good eating looks like, and for the most part it reminded me of a lot of tasty dishes I haven’t had in a while.  I’m going to try to follow them as best as I can.  I’m still not ready to become a herbivore, but I’m completely ready to become a “flexivore” and slow down my meat consumption to a more reasonable level.

There was tons of information in here that had me raising an eye brow, fat might not be all that bad for you, that was a big one. In spite of all the information floating around *cough* Atkins *cough*, which I generally consider to be nonesense. I have to confess going through this book that I feel more inclined to eat butter rather than margarine with its trans fat infused past.  CAn’t say I’m doing the book justice here, but suffice it to say I would recommend this book to anyone who is slightly interested in learning more about their food!

Posted in Books | No Comments »

Vacations and Work

August 21st, 2009

Oh summer, you are a time of such energy and adventure, relaxation and rest, rejuvenation and vitality. Here’s a little taste of what the summer has brought us so far.

Mt. Albert Edward

We thought we were nearly there.  Ha!

We thought we were nearly there. Ha!

Jo and I had a week of holidays which we split up between doing a 3 day hike of Mt Albert Edward (PDF Map), a very HOT 3 day hike. That was in the midst of the heatwave mid 30’s down in the Comox Valley, estimates from the ranger made it sound like it was probably high 20s or low 30s where we were, sheesh, i’m not built for that kind of heat!!

The trip was great, but I really do feel like the heat made it twice as hard. Had it not been for a pond of snow melt 3/4 of the way up to the summit we wouldn’t have made it to the top.

The Snow Melt That Saved Us!

The Snow Melt That Saved Us!


But when we did make the summit we had a delicious lunch and enjoyed a spectacular view. One I’ll not soon forget, if only for how hard we had to work to get it.

Sunshine Coast

After that we headed over to the Sunshine Coast for a couple nights to visit with Joanna’s family at their cabin over there. Had a great time, it was so warm and with the cabin right on the water we were able to stay reasonably cool by getting two or three swims a day. We had one completely awesome night swim up in the bio-luminescence, which was completely magical. Not to mention the opportunity to go water skiing. See picture of the water skiing Joanna.

Wahoo!

Wahoo!

Hardwicke Island

Finally we headed up to Hardwicke Island to finish off the holiday. It was cooling off by that time, so it wasn’t REALLY hot up at Hardwicke. We had a great time up there, just laying low, reading books, going to the lake and eating great food. I had some fun fixing up a few things for the power system and really enjoyed having more than a weekend to spend being up there.

New York for Work

Does it look like flashing lights?

Does it look like flashing lights?

Finally, New York. The flight was kind of long, 5 hours after we made it from Vic to Seattle. It was pretty hot and humid the whole time that I was there. But enough about my petty complaints, this is NYC. I got to see a few of the sights, Central Park, Times Square, eat some New York Pizza, go dancing and listen to BisMarky in a NY Club, so there I can’t say there was NO time for having fun. That said, the lion share of the time was definitely spent at the Affiliate Summit East Conference, talking, talking, talking and meeting people to try and make connections for constant-content.com. I shouldn’t forget that we did have the opportunity to go to see the Yankee’s pplay the Blue Jays at Yankee Stadium. Which was probably a once-in-a-lifetime experience, the Jays lost (that I fear isn’t a once-in-a-lifetime experience :-) ) It was certainly a worthwhile trip business-wise, but I’m glad to get home. A bunch of us got colds (on the plane I think) which was a real bummer, so Friday and Saturday this week, I was pretty useless. Just trying to keep my head above my shoulders.

And the summers not quite over yet!

Posted in Music | No Comments »

Hurt Feelings

June 23rd, 2009

Posted in Hahas | 1 Comment »

Too many passwords these days. Way too many. I’ve been keeping passwords on kitchen recipe cards ever since the passwords that get handed out at work started to become completely cryptic and beyond my ability to remember them. Which may seem like a pretty insecure way to keep passwords. But, if the bad guys are actually sitting at my desk, I figure I may have bigger problems.

Finally, I’ve decided to take the risk of actually storing my passwords on my computer. I’m not real jazzed about the idea, seeing as how if the hackers get into my machine and then into my password file then I’ll really have given them the keys to the castle. But, with way too many passwords, what is the average hacker to do.

I work on mostly Debian/Gnu linux systems these days (hurray free software!!). So if you’re working on some other operating system this may be completely irrelevant to you. So, for myself and others here’s how I’ve attempted to secure my passwords.

Enter GPG

GPG is some state of the art encryption techniques are often used to sending encrypted emails. But I found a few people who have used them for encrypting password files. So, this is the technique that I’ve chosen to follow. To get started you need a private key. At the terminal command line run

gpg --gen-key

I used the defaults for the questions it asked and then entered my details and non-forgettable, non-write-downable passphrase. More specific detail on getting started with GPG. Seems too simple, yeah, to me too. That provides a private key with which we can encrypt files. And you can encrypt whatever you would like, but it requires remembering a bunch of command line stuff that I would rather not try and recall, ( more about encrypting files for personal use from the command line here). Note: Once the password file is encrypted it’s not necessary to encrypt it by hand again.

So I created a new file called memories.txt and then encrypted it by typing on the command line

gpg --encrypt --recipient 'Jeff Richards' memories.txt

This produces a file called memories.txt.gpg. Now the original memories.txt can be deleted. Great! now how to add passwords, view them easily and re-encrypt the file as needed.

Vim and GPG plugin – Making Encryption Easier

At this point, ideally I’d have an encrypted file that I can open with my passphrase, and then read, write and close in an encrypted fashion. Enter vim plus the gpg plugin. Turns out someone has handily figured all this out. NOTE: the standard Debian install comes with vim-tiny. which doesn’t support plugins so the first step is to install vim proper (package name: vim).

Once that’s installed, next step is to install the gpg plugin file.

  • Grab the gpg plugin code and save it into a called gpg.vim.
  • Copy gpg.vim into the /home/your-username/.vim/plugin/ directory
  • If the directories .vim/plugin/ doesn’t exist, create it!

And… that’s it! try and open the encrypted file with vim, in my case

vim memories.txt.gpg

Enter the passphrase and your in, add and subtract and the file is encrypted when you exit the program.

My reading of the vim plugin seems to indicate that there won’t be any temp files created or saved anywhere. If anyone has any tips as to why if/how this is a terrible/insecure way to keep passwords, please let me know!