Results tagged “ubuntu”

SSH Tip: Hash Known Hosts

As any user of SSH is aware, the first time you connect to a remote host, OpenSSH caches the server's public key in ~/.ssh/known_hosts. If the server's private key ever changes, SSH will raise an ugly error alerting you of the risk that an untrusted third-party could be intercepting your new connection.

Unfortunately, the known_hosts file represents a small security risk. It contains a convenient list of all servers to which you connect. An attacker who gained access to your password or unencrypted private key would simply need to iterate down the list until your credentials were accepted.

OpenSSH can optionally hash the server names in known_hosts. This renders the file useless to prying eyes without impairing SSH's ability to check hosts against the list. Enabling this feature and hashing your existing known_hosts file is easy!

  1. Add the parameter "HashKnownHosts yes" to your ~/.ssh/config.
  2. Run "ssh-keygen -H".

Below the fold, I included a handy shell script that accomplishes the same thing.

One final consideration is your shell history storing your ssh commands. It's easy to configure bash to forget these. Just set HISTIGNORE="ssh *:scp *:sftp *" in your ~/.bashrc.

Remapping Mac Modifier Keys

I'm sure most Mac users encounter situations when they're forced to use a Windows keyboard. In my case, I attach a Mini and ocassionally my MacBook to a KVM switch shared by Vista, Ubuntu, and a Windows keyboard.

Up until now, I've just dealt with the fact that Windows keyboards switch the Option and Command key locations. I've trained my brain to use the Windows key rather than the key immediately adjacent to the space bar when I need Command. Previous versions of Mac OS had a feature that remapped the modifier keys, but this was a global setting that remapped all keyboards whether they be Windows or not.

I was pleasantly surprised when I discovered this dialog under Leopard's keyboard system preferences.

modifiers.png

That new drop down list at the top lets me create mappings for all keyboards or specific keyboards, identiifed by their USB device name. Very nice, Apple!

No PHP or MySQL!

I'm proud to say that this blog does not run PHP or MySQL!

PHP is the most prevalent web programming language thanks its ease of installation and popularity among web designers. MySQL is the most common open source database management system (on web sites, at least). Both are horrid pieces of software haphazardly thrown together. I'll surely rant about them later.

This blog is powered by Apache, Perl, PostgreSQL, and Movable Type with a little help from mod_include, all running on Ubuntu. (Alas, the FreeBSD VPS hosts were not as appealing.) I may be stuck using PHP and MySQL at work, but at least I can liberate myself at home!

1
Creative Commons License
This blog is licensed under a Creative Commons License.