Tuesday, December 27, 2022

setup password less connectivity between two Linux server using ssh-keygen

setup password less connectivity between two Linux server  




-bash-4.2$

-bash-4.2$ ssh-keygen

Generating public/private rsa key pair.

Enter file in which to save the key (/var/lib/pgsql/.ssh/id_rsa):

Created directory '/var/lib/pgsql/.ssh'.

Enter passphrase (empty for no passphrase):

Enter same passphrase again:

Your identification has been saved in /var/lib/pgsql/.ssh/id_rsa.

Your public key has been saved in /var/lib/pgsql/.ssh/id_rsa.pub.

The key fingerprint is:

SHA256:XHvRME2FNaXO6wAHk1wjPpjdzHwAJX6RY7yrvSfm7/g postgres@ip-172-31-86-192.ec2.internal

The key's randomart image is:

+---[RSA 2048]----+

|          ++O+.==|

|         B X=Bo..|

|        o @.Bo+  |

|       . . *.=   |

|        S o o.o  |

|           +.  . |

|           o. .  |

|          . ++.  |

|           o+BE  |

+----[SHA256]-----+

-bash-4.2$

-bash-4.2$

-bash-4.2$

-bash-4.2$
-bash-4.2$
-bash-4.2$ ssh-copy-id postgres@172.31.85.11
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/var/lib/pgsql/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
postgres@172.31.85.11's password:

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh 'postgres@172.31.85.11'"
and check to make sure that only the key(s) you wanted were added.

-bash-4.2$



try to test the login :


-bash-4.2$ ssh 172.31.85.11
Last login: Tue Dec 27 10:41:27 2022

       __|  __|_  )
       _|  (     /   Amazon Linux 2 AMI
      ___|\___|___|

https://aws.amazon.com/amazon-linux-2/
-bash-4.2$
-bash-4.2$


No comments:

Post a Comment

About the Author : Anurag Pandey | Database cloud Architect | Oracle | SQL Server | PostgreSQL | AI and Data Platform Enthusiast

Anurag Pandey is a Database Architect with expertise in Oracle, PostgreSQL, SQL Server, Linux, and enterprise database platforms and specializes in database architecture, performance tuning, high availability, disaster recovery, cloud modernization, and operational excellence. With extensive experience in enterprise-scale environments, Anurag is passionate about leveraging AI, automation, and modern data platforms to improve reliability, scalability, and business outcomes. He actively contributes to technical communities through knowledge sharing, architecture guidance, and thought leadership in database and data engineering domains.

Follow more articles at

Visit Blog

Create Resource Manager , Resource Group / Consumer groups in Oracle Database to limit CPU resources

  Step to create Resource Manager  consumer groups in Oracle Database  1. First confirm the exact PROGRAM values     SELECT program, ...