Main menu

Skip to content
  • About
  • Contact Me

Rushabh Ajay Hathi

The world where "IMPOSSIBLE" is spelt "I M POSSIBLE" !!!

RSS

Tag Archives: login

SSH login without passwords

Posted by R on April 2, 2014

We all use ssh logins for server. May be production servers and may be deployment servers. We are all used to login using passwords but if we have many servers , remembering all passwords might be an issue. Hence, for ease of use, a small thing we can do is login to our servers without passwords. The logic behind this is putting in public keys for authorized users in .ssh/authorized_keys file.

This might  help in security as well because the admin can do this procedure and authorize/ de-authorize a system from accessing the server. The passwords will remain only with admin and his/her team and hence risk of password leaking is less!

Step 1: Generate a public key:

ssh-keygen -t rsa

Step 2: Copy the public key
The public key is by default stored in ~/.ssh/id_rsa.pub file Open this file in your favourite editor and copy the key.

You can also use xclip for this.

Step 3: Login to your server
ssh username@servername

Step 4: Paste the key in ~/.ssh/authorized_keys file.
A single line command to do this:

cat .ssh/id_rsa.pub | ssh username@server 'cat >> .ssh/authorized_keys'

This should do the trick!

 

Hope it helps!

5 Comments Posted in General, General Computing, Linux, Uncategorized Tagged login, remote login, ssh, ssh without password

Find me !

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 884 other followers

Recent Posts

  • Manjunath part 1
  • Randomness
  • The happiest man alive!
  • Rails issues with Spring
  • At.js with froala issue

Thats in store !

Here I come !

Thats what I Like

active record apache Artificial Intelligence attr_accessible beta bundler c cachebusting call backs cimpile compile computer converntion over configuration cucumber Data typs delhi deployment documentation double filters Fingerprinting float functions gherkin git header files image imagemagick inheritence int java Java scripts jdk latex library linux long mac mixins modules multiple inheritance oracle paperclip paperclip.image passenger Postgres precid precise pangolin processing processors rack Rails rails 3 Rails3.1 Rails 3.1 rbenv red fort resize rgular expressions ruby ruby.linux ruby 1.9.3 ruby on rai ruby on rails rvm segmention fault single inheritance Sprockets string sun terminal testing Ubuntu world heritage ste zc

Blog at WordPress.com.