Skip to content

Password less ssh

September 2, 2011

#!/bin/sh

#$1: User

#$2: IP

## Should  run as root user

ssh-keygen -t rsa

ssh $1@$2 mkdir -p .ssh

cat /root/.ssh/id_rsa.pub | $1@$2 ‘cat >> .ssh/authorized_keys’

 

ssh-keygen -t rsa:  This will generate public and private  rsa key pair for security.  This should be called only once.  Press “Enter” for every step.

ssh : remote login. This will prompt for password.

last step “cat …” :  Send public key to remote host.

Advertisements

From → Linux

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: