Ssh with password saved

Ssh is a very convenient way to remotely command or control other devices. We use ssh to push commits to git server, to access remote server, and even to manipulate the content of our iphones and ipads. However it’s usually distributing to type your long and elusive password every time. Therefore here I would like introduce a way to create a steady relationship between your computer and the remote server you wanna connect with.

The principle is this, ssh connection establishments requires verification using the computer unique key of both devices. in order to simplify this step, we can generate a public key of your computer in advanced and which allows other to identify you. While you put that public key in the remote device as authorized key, you can kinda fast forward the process.

step 1: open terminal and “ssh-keygen -t dsa”
step 2: open “.ssh/id_dsa.pub” and copy content inside
step 3: open new tab in terminal and ssh server
step 4: paste all content into /home//.ssh/authorized_keys

a@A:~> ssh-keygen -t rsa
a@A:~> ssh b@B mkdir -p .ssh
a@A:~> cat .ssh/id_rsa.pub | ssh b@B ‘cat >> .ssh/authorized_keys’

Advertisements

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: