RSSCategory: OS X

Public Key authentication using ssh


Something thats been puzzling me for a little while was preventing password authenticated logins to the OS X Server with via ssh. Setting this up on a Linux box is a sinch but for some reason I couldn’t get this done on OS X.

Finally this has been solved.

cd in to your local .ssh directory. If you don’t have one then run the line below and it will take care of that.

[code language=”plain”]mkdir ~/.ssh; cd ~/.ssh

The next step it to generate you public and private keys

[code language=”plain”]ssh-keygen -t dsa

Follow the prompts and enter you chosen password. Choose wisely and remember it. The next step is to copy the public key over to the remote machine and create the appropreate key file.

[code language=”plain”]cat ~/.ssh/ | ssh ‘cat >> ~/.ssh/authorized_keys’

Now we have the basics in place try to ssh in to your remote server ssh and you should now be asked for you public key password. Yes the one you used to create the public and private keys. This you can save in your keychain should you wish. Now with the password entered you should be able to straight in to the remote server.

Now that we have access to the server my advice would be to open another terminal window and log in to the server for a second time. This is a safe guard and a way to correct any errors or typo’s you may have during the next steps.

Now open the /etc/sshd_config file, I use vim but nano is equally as good. As always create a cpy of the orginal file before we edit it.

[code language=”plain”] sudo cp /etc/sshd_config /etc/sshd_config.old; sudo vim /etc/sshd_config

I created a sectoin within the file so I can locate my edits and entered or un-commented.

[code language=”plain”]# Authentication:

LoginGraceTime 1m
PermitRootLogin no
StrictModes yes
MaxAuthTries 4
MaxSessions 4

RSAAuthentication yes
PubkeyAuthentication yes

# My Additions…
ChallengeResponseAuthentication no
PasswordAuthentication no
UsePAM no

The above are the edits I have made to my sshd_config file. Copy the missing lines and edit the exsisting to match the above.

Now log out of one of your current ssh sessions and the log back in. You shhould all being good log in with public key authentication, no password prompt. Now log out and try to log back in with a user who has remote login permission. You should be denied access.

All is working as it should.

May 25, 2015 | By | Reply More

OS X Server – Caching

I’ve been running OS X Server for some time now and all has been running just nice and smooth. That is all but the Caching of apps & iTunes updates etc. I have been racking my brain trying to figure out why only a small percentage of updates are cached.

After upgrading my server 10 Yosemite I thought I’d investigate further. As it turned out I didn’t have to look far. This Apple Support Page – highlighted the problem.

I have a UK Apple ID and I live in China. So the Caching Server might not be the best option for me.

November 19, 2014 | By | Reply More

Backing up iOS purchases

I keep my iTunes Library on an external Hard Disk. Nothing wrong with that I guess. Well that is until your external disk fails. Then you have lost all of your purchases and music. 

All is not lost however if your disk fails there are some steps you can take to download all your apps.

Firstly connect your iOS device to iTunes and transfer purchases. This will copy all the paid content from you device in to your iTunes Library.

Secondly you can re-download all your purchases from the App Store through iTunes.

Open iTunes if you haven’t already. I’m on iTunes 12 here but the steps and buttons should be labeled the same only in different places. 

Select Apps and the click the App Store button

Now scroll down to the very bottom of the App Store window and look for the ‘Features’ label.
Now click on ‘Purchased’ and you should be taken to all of your purchases for your account.
From here you can download all of your purchased music, tv shows, movies and apps.
Depending on your connection speed this could take some time.

October 29, 2014 | By | Reply More

iOS 8 Screen Recoding in Yosemite

This has been documented all over the internet and this is yet another post on the subject. But this is such a neat trick I wanted to post to my own site, more as a place for me to find it later than to have to search. Yes, I’m getting on in years and my memory isn’t as sharp as it used to be. Thats my excuse and I’ll be sticking to it.

So here is how to record you iOS device’s screen in as few-a-steps as possible. 

Connect you device to you Desktop or laptop with a lightening cable

Open quicktime player: Press command+space and type Quicktime and then press Enter/Return

With Quicktime open press Command+Option+N. A window will open with your isight camera view, most likely of yourself.

To the right of the red record button there is an inverted triangle. Click this and you will see your iOS device listed.

Select your iOS device and a new window will open with your iOS devices screen in it.

To record your screen move the mouse pointer in to the iOS Devices screen and that red record button will reappear. Click it to start recording.

Six simple steps to record your iOS Devices screen. This is a great way to record demo’s of your iPhone or iPad’s screen. Great for the use in presentations etc.

October 22, 2014 | By | Reply More