setting up ssh for your server
Contact me at LinkedIn  RailsZilla at Facebook  RailsZilla at twitter   google +1  Contact me at Xing  connect me at github

setting up ssh for your server

Posted in coffee break

SSH (Version 2)

Today I have a quick guide for setting up SSH private/private keys. I allways forget to write it down, because i do not use it often (c’mmon guys, how often are you setting up a new server when everything is running …)

This post is now my small place for checking up, so I don’t have to bore google to death if i forget the exact procedure ;-)

First step, open a local terminal and type:

ssh-keygen -t dsa

Now the public/private dsa key pair will be generated.

Just hit enter …

Enter file in which to save the key (~/.ssh/id_dsa):

Just hit enter …

Enter passphrase (empty for no passphrase):

Just hit enter …

Enter same passphrase again:
Your identification has been saved in ~/.ssh/id_dsa
Your public key has been saved in ~/.ssh/
The key fingerprint is: (some damn long string appears...)

Step 2:
now we have to paste the content of the local ~/.ssh/ file into the file ~/.ssh/authorized_keys on the remote host.

If you are paranoid or stressed… use RSA instead of DSA, it’s stroooooonger …

ssh-keygen -t rsa -b 4096

now instead of the names id_dsa and, it will be id_rsa and The rest of the steps are identical.

If you followed thee steps and SSH still asks you for the password, then check your remote .ssh directory. It should have only your own read/write/access permission (octal 700). You can do a:

chmod 700 ~/.ssh

It’s that simple!

Tags: , , , , , ,

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Please enter a secure code to see if you are a spammer ;-)


Copyright © 2011-2018  - RailsZilla – Ruby on Rails tutorials, tips and tricks All rights reserved. | Imprint | Privacy