Saturday, March 21, 2009

Disabling ssh password access

I am going away for a few days and have decided that I want to be able to access my main machine from my laptop. I normally use ssh for logging in from one machine to another and normally use private keys for all my ssh connections but do have password access available as well. However, this time, as I plan to leave TCP port 22 (the ssh port) open through my home router to my iMac and I want it to be as secure as possible. This means that I do not want password access at all, only private keys.

So, I have edited the /etc/sshd_config (or /etc/ssh/sshd_config) file to include the lines:

PasswordAuthentication no
UsePAM no

These lines turn password access off and force ssh to require the use of a private key. If you don't have a key that allows login then login is immediately rejected. I feel pretty secure as far as ssh is concerned now.

I just have to remember to copy the public key from my laptop to my iMac before I leave!

Tuesday, March 10, 2009

Opening Tabs in Safari 4

I've downloaded and have been using the new Safari 4 beta. It's great, I love the new tabs and the fact that I can drag them in and out of windows (using the little triangular icon in the top right of the tab) makes them very manageable. I've even given up using Camino, I'm very happy with the new version.

I'm still getting used to the tabs being at the top rather than under the address bar. I could change it, however it does make sense because the address bar belongs to the tab, so it should be included inside the tab. Another example of Apple doing things properly.

Ok, I have one slight problem, when I click on a link in GMail or Reddit I get a new window opened rather a new tab in the same window. The preferences don't help, they only have "open a new tab in the same window if a link is clicked on by an application like Mail or iTunes etc." The fix? Open a terminal window and enter the following at the prompt (this is one single line, it may have been broken into two by your browser):

defaults write com.apple.Safari TargetedClicksCreateTabs -bool true

Thereafter, Safari will preferentially open a new tab in the current window instead of a new window. This will not affect the normal links that replace the current page, they will still work in the same way. Give it a try, if you don't like it you can undo the action with:

defaults write com.apple.Safari TargetedClicksCreateTabs -bool false

As an extra, if you really don't like the tabs being above the address bar and want them in the old place then you can again use a terminal window and enter:

defaults write com.apple.Safari DebugSafari4TabBarIsOnTop -bool false