Showing posts with label pki. Show all posts
Showing posts with label pki. Show all posts

Saturday, November 1, 2008

SSH pubkey on a NetScaler Application Switch

I like to take a backup of all my device configurations on a regular basis. Its usually pretty straight-forward, simply add a scp command to cron, but with the NetScaler there's a little gotcha.

The default location of the authorized_keys file is in '/flash/nsconfig/ssh'. After you append your public key into the file, you'll need to copy the 'authorized_keys' file to '/root/.ssh/'.

This filecopy will need to be done after every reboot of the NetScaler because the / mount point is on volatile media.

If you want to script this action, or any other post-boot commands on a NetScaler device, create or edit the file '/flash/nsconfig/rc.netscaler', set the perms on the file to 755, and start adding commands to the file.

 

Sunday, September 28, 2008

Using PKI with SSH

If you're concerned about the global increase in brute-force SSH login attempts, you can use PKI to prohibit successful unauthorized authentication through password guessing.

Generate key pair
# keygen -b 1024 -t rsa -f ./rsa_id_clientname

Add/append public key to ~/.ssh/authorized_keys file on the target

Add/append a few lines to ~/.ssh/config on the client
Host
User
IdentityFile ~/.ssh/

Attempt new SSH session