web analytics

Blog

SSH passwordless login

Tags: authorized_keysauto loginautologinloginpasswordlessscpssh

Published on: January 26, 2010 by George K.

SSH passwordless login

Scenario:

SSH passwordless login to another server can be very useful when you want to configure a remote backup server or when migrating servers. For enabling this you need to have openSSH installed on the server.

Here is a tutorial on how to configure password less SSH login to server ‘mars’ from server ‘Earth

1. Login to Earth as root.

2. Run the command ssh-keygen -t rsa
If the key already exists you can either go to step 3 or you can generate a new key by overwriting existing key (see image). It would be better to overwrite the existing key if you did not generate it.

public-key

3. Change directory to /root/.ssh/

root@earth:~# cd /root/.ssh/
root@earth:~/.ssh#

4. Copy the contents of the file id_rsa.pub to the directory /root/.ssh/authorized_keys in remote server ie Mars

scp -P <port no>   id_rsa.pub root@mars_server_IP:/root/.ssh/authorized_keys

5. Now set permission for the file

  chmod 600 authorized_keys

6. Now try to login to server “Mars” from Earth using the following command

Earcth#ssh root@mars_server_IP -p

 

Category : General, Howtos, Linux, Security, Troubleshooting

George K.

George K.

George started his career in web hosting and Linux technical support in the year 2004 and is with SupportSages since 2009. He has keen interest in server optimizations, custom security solutions, hacked server recovery, cyber forensic and high availability fail over system design and implementation. George loves long drives and is passionate about art and literature.

You may also read:

Comments

Add new commentSIGN IN

Let's Connect

Get new updates

Categories

$0.000 items