Main Menu

friends

Banner

Latest articles

the easy way to kill processes
29/12/2009 | mad mad mod

Use pkill to kill processes based on their name. For example to terminate all instances of mplayer:


# pkill mplayer
    


FLOSS weekly
30/09/2009 | mad mad mod

FLOSS weekly FLOSS is an acronym for free/libre/open source software. Floss weekly is a podcast from the TWiT Network. The show contains interviews with prominent developers from the open so [ ... ]


Other Articles

Designed by:
SiteGround web hosting Joomla Templates
ssh key exchange or how to logon without entering a password E-mail
sysadmin

Sometimes you want to jump from one server to another without entering the password. What you have to do is called "key exchange". Although this is very easy to set up many people don't know how to do this. This is a very straight forward copy/paste tutorial about how to exchange ssh keys.

Situation: You want to be able to ssh from servera to serverb (and vice versa) without entering a password

Step 1: create your public and private keys on server A (servera)


# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/madmadmod/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/madmadmod/.ssh/id_rsa.
Your public key has been saved in /home/madmadmod/.ssh/id_rsa.pub.
The key fingerprint is:
9f:e5:a7:12:46:69:52:34:63:ff:3b:8c:39:74:cd:be madmadmod@servera


--> do not enter a passphrase (just press enter)

Step 2: do the same on server B (serverb)


# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/madmadmod/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/madmadmod/.ssh/id_rsa.
Your public key has been saved in /home/madmadmod/.ssh/id_rsa.pub.
The key fingerprint is:
3f:e5:a7:12:46:69:52:34:63:ff:3b:8c:29:14:cd:be madmadmod@serverb


--> do not enter a passphrase (just press enter)

 

Step 3: Exchange the public keys


copy the public key from /home/username/.ssh/id_rsa.pub from servera to a file called /home/username/.ssh/authorized_keys2 on serverb. You can do this manualy (copy+paste) or with the following command:


#cat ~/.ssh/*.pub | ssh madmadmod@serverb 'umask 077; cat >>/home/madmadmod/.ssh/authorized_keys2'



 

and now do the same with the public key from server b:

 

#cat ~/.ssh/*.pub | ssh madmadmod@servera 'umask 077; cat >>/home/madmadmod/.ssh/authorized_keys2'

Comments (0)
Write comment
Your Contact Details:
Comment:
[b] [i] [u] [url] [quote] [code] [img]   
:D:angry::angry-red::evil::idea::love::x:no-comments::ooo::pirate::?::(
:sleep::););)):0
Security
Please input the anti-spam code that you can read in the image.

!joomlacomment 4.0 Copyright (C) 2009 Compojoom.com . All rights reserved."

 
mad mad mod, Powered by Joomla! and designed by SiteGround web hosting