Category: General

Converting SSH2 Public Keys for Use in authorized_keys

When working with SSH keys, you may encounter different formats depending on the tool that generated the key. For example, PuTTYgen and older Windows tools often produce keys in the SSH2 public key format, which looks like this:

Linux and OpenSSH, however, expect a different format for the ~/.ssh/authorized_keys file. If you try to paste the above directly, SSH will reject it. Fortunately, converting between formats is straightforward. Step 1: Save the SSH2 Key Copy the entire block, including the BEGIN and END lines, into a file. For example:

Paste the contents, then save and exit. Step 2: Convert to OpenSSH Format Use the ssh-keygen tool to convert the key:

This tells ssh-keygen to import (-i) the SSH2 key and write the OpenSSH version into id_rsa_converted.pub. Step 3: Inspect the Converted Key Open the new file:

You’ll see a single line similar to this:

Notice

Read More »

Redirect Generator

Happened onto this “301 Redirect Generator” page today: http://www.rapidtables.com/web/tools/redirect-generator.htm What’s notable is that it can generate PHP, ASP, ASP.Net, .htaccess, HTML meta tag and Javascript redirects. I used it to generate some redirects on a Windows server in ASP.Net. Noted too is the lack of support for Web.config HTTP Redirects and Nginx. Anybody know of a better tool for generating redirects?

Read More »

Hosts File On Mac

Here’s a great little article on how to edit the hosts file on a Mac: How to edit the hosts file in Mac OS X – Leopard

Read More »

SSH session logging

Add the following line to /etc/profile to setup full logging of all ssh sessions: script -q /var/log/sessions/ssh-date +%d-%M-%Y-%Hh-%Mm-%Ss–whoami-$$.log && exit Of course this is a security risk and violates user privacy.

Read More »

Rename file via scripted FTP

Here’s an lftp script to rename a remote file vi FTP without downloading the file:

Read More »

Categories

Get a free consultation from Reliable Penguin

Submit the form—or for immediate service call 866-649-7984.