Using Private Keys with SSH login Without Password on Mac OS X

Here’s an excellent write-up for setting up SSH access using private keys to connect to other Linux/Unix servers without having to enter a password.

http://smbjorklund.no/ssh-login-without-password-using-os-x

Copied here for reference.

Tired of typing passwords to SSH servers you often access? Well get used to it! Passwords provide a high level of security, but but it have a tendency be tedious, and also prevent you from running local scripts that automatic logon to your server to perform tasks or you you simply will backup/copy files from your server to your local Mac. The good news is that’s a simple solution to all this.

SSH and keys, WTF


To enable automatic login to a SSH server, the server must have a copy of your public key. The key is signed by what we call a passphrase, meaning that, when you now access a server that got a copy of your public key it prompt your for your password (passphrase) instead of the system user account password. So we really did not fix the problem, we just shifted the problem, but we shifted it in the right direction, and now we can do something about it.
ssh public key
Passphrase exchange

Empty passphrase

The most daring users, simply create a public key with a empty passphrase. This introduce a security problem. If you somehow gained access to a copy of your privat key, they will gain access to all the servers that trust your key.

Use a agent to propagate the passphrase

Keychain Access
A more secure way of solving this is using a program (ssh-agent) to propagate the passphrase. This solution is quite good, but like everything else it comes with a few drawbacks. You need to have your shell environment set up correctly, and only application with the correct environment setting is able to benefit from it. In OS X you are able avoid this problem simply by using the system utility “Keychain Access”. It will store and propagate your passphrase, and in Leopard (10.5) Apple finally introduced native support for using Keychain Access also in terminal.

Setting it all up

OS X has native support for creating and storing pass phrases (Keychain access) so setting this up on your Mac is not that hard. Linux users that are reading this can also follow along then the only difference is what application you use to store the passphrase. Like an example will Gnome users normally use the Gnome Keyring application.

  1. Create your set of keys:
    Start up the Terminal application and run:
    ssh-keygen -t rsassh-keygen will the ask where to store the public key it is about to create. Normally the default suggestion works just fine (~/.ssh/id_rsa.pub). ssh-keygen then ask you to enter a pass phrase. Please use something secure here and please also remember it.
  2. Copy the public key to your SSH server
    Copy the newly created public key to the SSH server(s) you need to auto login into by using your favourite transport method. Please be careful not to overwrite ~/.ssh/authorized_keys if it already exist! This is how I personally copy the key, might not be your preferred method:

    • If authorized_keys exist: 
      cat ~/.ssh/id_rsa.pub | ssh username@example.com "cat - >> ~/.ssh/authorized_keys"
    • If authorized_keys does not exist: 
      scp ~/.ssh/id_rsa.pub username@example.com:~/.ssh/authorized_keys
  3. Optional step: You might consider restricting file access to the file authorized_keys on the SSH server. chmod 0600 ~/.ssh/authorized_keys to even further improve your system security.

Keychain store passphrase
Now you should be all set. The very first time you access the server by ssh, Keychain will prompt you for your keyphrase and then store it and you will never have to type it again.

Using StreamBaby Application to Stream MP4/M4V Files to Tivo 3 HD (with No Conversion)

This how-to lesson describes how to view MP4/M4V (Quicktime/Apple formatted) movies on your Tivo 3 HD and above (including Tivo Premiere) with no conversion needed and without the need to buy the Tivo Desktop Plus software.

Download “StreamBaby” Application

media_1262707181730.png

A great program that has been made is called “StreamBaby”. This program allows you to stream MP4/M4V files to your Tivo 3 HD. You can get it at: http://code.google.com/p/streambaby/

Click on the “Downloads” tab in order to select the file to download. You’ll install this on the PC that you want to stream movies from.

media_1262707224447.png

Click on the zip file to download. Then extract this file somewhere that you can keep it.

Editing the Configuration File

media_1262707256656.png

Once the program has been extracted, doubleclick on the file “streambaby.ini”. We’ll need to edit some settings in this configuration file before we start the program.

Adding Your Video Location

media_1262707280259.png

Type in the path where you want to share your videos from. In my example above, I keep my videos under: D:\Shares\Videos\My Tivo Recordings

Your path may be different than this, so be sure to enter it correctly.

Install Java

media_1262707389566.png

The StreamBaby application uses Java to run, so you’ll need to make sure that Java is installed on the PC that you are sharing your videos from. To install Java, open up Internet Explorer and go to: http://www.java.com

Click on the blue button that says “Free Java Download”.

If you know you already have Java installed, then you can skip this step.

media_1262707425780.png

Next click on the “Free Java Download” button to start the actual Java installation program download. Go ahead and run this program to install Java.

Starting the StreamBaby Application

media_1262707537211.png

Now, doubleclick on the file called “streambaby.bat” to start the StreamBaby application.

media_1262707614856.png

The first time that it loads, you will see a screen similar to the one above. Once the StreamBaby application is started, you should see a message that it is “Ready and Listening” as shown in the screenshot (1). DON’T CLOSE THIS WINDOW as this exits the program. To keep StreamBaby running, you’ll need to Minimize the window (2).

Testing it Out

media_1262708496169.png

Now, let’s give it a test. I have a M4V file located in my directory that I specified in the configuration file. Now let’s go to the Tivo and see if we can watch it.

Onto the Tivo HD

img_0137.png

Now, on your Tivo, go to Tivo Central and choose the “Music, Photos, & Showcases” option.

img_0138.png

Scroll down a couple of pages and you should see “Stream, Baby, Stream” listing, which you should choose.

img_0139.png

Accept Tivo’s Privacy policy by pressing the green Thumbs Up button 3 times and then press the Enter button (this is a one time step).

Browsing Videos

img_0143.png

Now, you will see a top level folder that you can select. If you setup more than one folder in the configuration file, then you will see those here.

Selecting Movie File

img_0144.png

There is our test M4V file, which is the movie “I Am Legend”. Press the “Select” button to choose your movie.

img_0145.png

A “Please Wait” screen will be shown briefly.

Playing the Video

img_0146.png

Then, you can select the “Play” option to begin the movie streaming.

img_0147.png

Here’s a screenshot of the beginning of the movie playing from the Tivo HD.

Preview Past Stream Buffer

img_0148.png

A really cool feature with StreamBaby is that if you need to Fast Forward to a place that isn’t streamed yet, it will give you a static preview window (much like the Netflix integration on the Tivo) to help you find the location that you would like to go to. Then when you press the “Play” button, it will start streaming from that location.

Hope this has helped you! It works great so far in my experience!

Great Links for Working with and Making Cat 5e or 6 Network Cable

I finished a little household project which was running Cat5e cable from my living room and master bedroom to the switch in my office. This was to connect two Tivo’s to the home network, so that everything is running Gig-E over the wire and so that I don’t have to mess around with connecting the Tivo’s wirelessly (and I’m hoping that the hard connection will make Netflix video streaming performance better than wifi). The project included making wall plates, drilling the holes, running the wire through my unfinished basement, etc.. Here are two very helpful sites that helped with the networking questions that came up.

Question 1: How do I connect the Cat 5e cable to a Wall Plate? The colors don’t match at all.
Answer: This site nailed it for me and worked great. And it’s easy to read and understand.
http://server-servers.com/ge-cat5-network-wall-plate-straight-through-cable-setup/

Network Wall Plate Cat5 Ethernet Cable
1 Blue
2 Orange
3 Black
4 Red
5 Green
6 Yellow
7 Brown
8 White
White / Orange
Orange
White / Green
Blue
White / Blue
Green
White / Brown
Brown

Question 2: How do I make a “standard” Cat 5e network cable again? I forget the “official” color layout when connecting the ends..
Answer: This site has a great picture for the “official” wiring: 568-B method.
http://www.lanshack.com/make-cat5E.aspx

Pair # Wire Pin #
1-White/Blue White/Blue 5
Blue/White 4
2-Wht./Orange White/Orange 1
Orange White 2
3-White/Green White/Green 3
Green/White 6
4-White/Brown White/Brown 7
Brown/White 8

Windows 7 – Another Area for Program Data that isn’t under Program Files

I have a small program that keeps some of it’s files (which happen to be data files) where the program resides, typically under C:\Program Files\Name of Program\. I normally back these files up as they are important to me. However when I went over to Windows 7, I noticed that the program files are no longer under C:\Program Files\Name of Program\ and where nowhere to be found. After some exhaustive searching on Google and using Windows Search, I found the “new” location these files are kept:
C:\Users\Name\AppData\Local\VirtualStore\Program Files\Name of Program\. So I pick this new location in order to back up the files that I need. Hope this might help someone else wondering where their files went. I know it was quite weird for me at first..

Simple But Effective Backup For Your Data

Backups! Most people don’t think about them until it’s too late. Well, here are my two favorite options for performing a backup of your data.

http://www3.crashplan.com/consumer/index.html = Crashplan is a free Program to automatically backup your data to another drive (e.g. an external drive) or another computer of yours, or even a friend that’s running Crashplan! They have an online backup option ($5/month for unlimited amount of data). Go buy an external drive, download and install this program and tell it to backup to your external drive. It’s that simple. I’d also recommend using their $5/month service so that you have a copy of your data outside of your house. That is very important as an external drive backup doesn’t protect your data in a fire, flood or other major disaster. $5/month is a small price to pay for the extra level of protection!

https://www.backblaze.com/ = Backblaze is another option which is a pure online backup solution with unlimited data for $5/month. They don’t have the “backup locally” option like Crashplan does above, but if you’d like to skip that part and just backup online, then checkout BackBlaze.

Hope it helps!!

Scanning and Getting Things from Your iTunes iPhone Backup (Mac)

I was having some performance issues with my iPhone and I wanted to clear it out and did a “factory restore” from within iTunes and then just sync back my apps from iTunes. Well, that all went ok. I use Microsoft Exchange at work and I have my iPhone synced with my Exchange account, so it handles Contacts, Mail and Calendar. So I wasn’t worried about that data as I can always sync that information. (BTW, if you don’t have an Exchange account, use GMail’s free ability to do the same thing, which actually uses Exchange technology: http://www.google.com/mobile/products/sync.html#p=default).

But the thing that I forgot to make copies of or send them to myself in an email were my Notes on my iPhone. iTunes makes a backup of notes and the like, but I didn’t  do a “restore” from within iTunes, I did a complete reset. I also didn’t want to do a restore in case whatever was slowing down my iPhone might return from the restore. So the question came up – How do I get my notes back from my iTunes backup without doing a restore?

Answer = MobileSyncBrowser! It’s a program I found that does exactly what I wanted and is totally awesome. It can also do pictures, media, call logs, contacts, calendar, SMS messages, etc! Info about it can be found here:
http://www.versiontracker.com/dyn/moreinfo/macosx/33166

The maker’s website and download link is at: http://homepage.mac.com/vaughn/msync/beta/

It worked perfectly for me. I was able to open my notes and just re-enter them (as they were short) on my iPhone. Enjoy!

Here’s a screenshot taken during my session:
mobilesyncbrowser

Merging Two AVI Files into One File on a Mac

This is one successful way that I’ve found to merge 2 AVI files into 1 AVI file using a Mac.

Get D-Vision 3 Software (Free)

Download the D-Vision 3 software from this site:
http://www.objectifmac.com/english/downloads.php
Download the program and install. Then launch the program.

D-Vision 3 – Tools

media_1247258407168.png

Once the program launches, click on the "Tools" button on the right hand side of the window.

media_1247258694272.png

On the "Tools" screen, select "Join AVI Files".

media_1247258769806.png

First select the target name and location for the target AVI file (1). Then select the plus (+) sign to add the files in order that you want to join (2). Finally click on the "Create Task" button to make the task (3).

media_1247258940210.png

A new window called "Task Management" will appear. It is not doing anything yet and for the task to be started, you will have to click on the "Launch" button. Once you click on the Launch button, the merging of the files will begin. It is pretty quick, as the 2 AVI files that I had were both around 500-600MB in size took about 3-5 minutes to merge into a single file.

media_1247258372729.png

Once the task is finished, you are done and your newly created AVI file will be at the target location you specified.