Access Remote Machine without Password using SSH

Hello Friends,

Hope You all are doing well 🙂

Once again “Happy Ramdan Sahrif to All “

Today I am gonna share with you that “How can we access remote machine without password” ??

Image

In this scenario I have a machine linux.sahil.com that having ip 192.168.11.10 and other one is my remote machine is zen.sahil.com having ip is 192.168.11. 98

I have to access 192.168.11.98 machine from 192.168.11.10 without using Password.

Lets start 🙂

Generate Key :-

[root@linux ~]# ssh-keygen -t dsa

Generating public/private dsa key pair.

Enter file in which to save the key (/root/.ssh/id_dsa): Enter passphrase (empty for no passphrase): Press Enter

Enter same passphrase again: Press Enter

Your identification has been saved in /root/.ssh/id_dsa.

Your public key has been saved in /root/.ssh/id_dsa.pub.

The key fingerprint is:

31:e0:70:ab:de:a8:e7:b9:af:c0:80:c9:a0:29:83:09 root@linux.sahil.com

The key’s randomart image is:

+–[ DSA 1024]—-+

| . o |

| + o |

|E o o |

|B+ . o |

|@. . S |

|.+ . o |

| o o . |

| o.. |

| .o=+. |

+—————–+

Copy the key to remote machine for Password less access:-

[root@linux ~]# ssh-copy-id -i ~/.ssh/id_dsa.pub 192.168.11.98

“Thank You !! ”

root@192.168.11.98’s password: Give your remote password for only one time

Now try logging into the machine, with “ssh ‘192.168.11.98’”, and check in:

.ssh/authorized_keys <———- key store here

to make sure we haven’t added extra keys that you weren’t expecting.

Now Try to access remote machine :-

root@linux ~]# ssh 192.168.11.98

“Thank You ji !!”

Last login: Sat Jul 27 17:13:02 2013 from linux.sahil.com

[root@zen ~]#ifconfig <———— I am here on my remote Machine (192.168.11.98)

eth1 Link encap:Ethernet HWaddr 00:1F:29:EF:A1:50

inet addr:192.168.11.98 Bcast:192.168.11.255 Mask:255.255.255.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:175493 errors:0 dropped:0 overruns:0 frame:0

TX packets:2792 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:18407267 (17.5 MiB) TX bytes:234359 (228.8 KiB)

Interrupt:177 Memory:fa000000-fa012800

lo Link encap:Local Loopback

inet addr:127.0.0.1 Mask:255.0.0.0

UP LOOPBACK RUNNING MTU:16436 Metric:1

RX packets:16229 errors:0 dropped:0 overruns:0 frame:0

TX packets:16229 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:0

RX bytes:5686170 (5.4 MiB) TX bytes:5686170 (5.4 MiB)

virbr0 Link encap:Ethernet HWaddr 00:00:00:00:00:00

inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:0 errors:0 dropped:0 overruns:0 frame:0

TX packets:23 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:0

RX bytes:0 (0.0 b) TX bytes:3650 (3.5 KiB)

Thats it 🙂

We are able to login Remote machine 192.168.11.98 without password 🙂

Hope you like it ……..

Enjoy Linux-Ing 🙂 🙂 🙂

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top