Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Generate secure ssh keys (See related posts)

Here's how to get to a quick secure shell login. On your computer (replace all values in CAPS of course):

cd ~
ssh-keygen -t dsa


(just hit return at any prompts, even if it asks for a password). Then:

scp ~/.ssh/id_dsa.pub YOURUSER@YOURSERVER.textdrive.com:~/.ssh/authorized_keys


And put in the password for your account when prompted. Next, add the following to ~/.ssh/config:

Host SOMESHORTCUT
Port 22
User YOURUSER
Hostname YOURSERVER.textdrive.com
KeepAlive yes                                                                   


Restart the local shell, and then whenever you want to login to your server, just type:

ssh SOMESHORTCUT


...and you'll zip right in.

Comments on this post

nickstenning posts on Jun 03, 2005 at 10:48
scp ~/.ssh/id_dsa.pub YOURUSER@YOURSERVER.textdrive.com:~/.ssh/authorized_keys


Dean, the only problem with this line is that it'll overwrite any other authorized_keys you already have.

See my new snippet here for a slightly more foolproof way of doing this.

You need to create an account or log in to post comments to this site.


Related Posts