OSX forgets my SSH key every time I reboot!
In my previous post I talked about the steps I took to get Openshift all set up on my OSX Lion Mac. Since then I’ve noticed a small problem…
Every time I reboot the computer the SSH agent forgets about my SSH key. I’ve since figured out a way to make it stick..
When I said to run sudo ssh-add ~/.ssh/libra_id_rsa I was wrong!
Firstly: when you use sudo you’re changing which user you’re running the ssh-add command with, you want to add the SSH key for yourself, not the superuser. I ended up with the sudo on the front because I didn’t have file permissions to the SSH key files, I fixed this by using the command sudo chmod 0666 ~/.ssh/libr*
Secondly: OSX doesn’t seem to want to add the SSH key permanently to the SSH agent, unless you add the key to your keychain, you do this by using the -K option.
So, we come up with the following command…
ssh-add -K ~/.ssh/libra_id_rsa
(without sudo and with a -K).
Now I can reboot and my SSH key stays in my SSH agent and I don’t see the old “Connection timed out fatal: The remote end hung up unexpectedly” message ever again. (fingers crossed!)
Create an Openshift PHP application with Mongodb
These are the steps I used to accomplish this on my Mac running OSX Lion. These steps do not include installing the Openshift tools and GIT, these things should be done first and you can find help on these steps here.
Remove any old openshift SSH keys. This should only be necessary if you’ve created an Openshift domain previously on this local machine.
rm ~/.ssh/libra*
Create openshift domain. This will generate the SSH keys on Openshift and your local machine.
sudo rhc domain create -n domainname
Add new Openshift SSH key to running ssh agent. I missed this step the first couple of attempts.
sudo ssh-add ~/.ssh/libra_id_rsa
[update : 28th May 2012] See this post for why this command is wrong.
Create a PHP app.
sudo rhc app create -a appname -t php-5.3
Add an alias for subdomain
rhc-ctl-app -a appname -c add-alias —alias appname.domainname.com -l emailaddress
Add mongodb cartridge
rhc app cartridge add -a appname -c mongodb-2.0
wow.. he’s finally put it a way I can understand. python threaded http server here we come!
There’s nothing quite like a properly tailored suit.
oh yeah, that Santa is a good looking bloke. He really does have my eyes.
So here I am tidying up my office at work.. and i find this funny long piece of foam with one sticky side.. and my first thought, of course, is that it would look good on my head!
here’s a sneak peak at my rockwall/mailbox that is currently under construction.. it’s taken quite some time (over 2.5 years) so far as I am so slack ;) But lately I have been making good progress with it.
hmmm… just as I thought, my moustache left a lot to be desired!.. go Lewis!
Those who cannot remember the past are condemned to repeat it.
“
| — |
George Santayana (1863–1952)
|
here’s my not-so-great Movember moustache. Nothing like a slow growing moustache to make you feel adequate ;) ..