Main Menu

friends

Banner

Latest articles

find world writable files
09/01/2010 | mad mad mod

No file on a server should have o+w permissions (at least I can't think of a reason).The command to find all world writable files on system is: # find / -perm -0002  -type f -print
This command will [ ... ]


How to get the current network bandwidth usage on Linux
07/04/2010 | mad mad mod

There are many ways how to get the current bandwidth usage on Linux. This is a very simple shell script that lists the network statistic every second: #!/bin/bash
if [ -z "$1" ]; then
       [ ... ]


Other Articles
Facebook MySpace Twitter Digg Delicious Stumbleupon Google Bookmarks 

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