Place of all tech articles

techarticles

  • Home
  • About
  • aStore
  • Contact Info
  • Tools
    • SEO Page Audit
    • SEO Keyword Rank
    • google pagerank checker
    • whois

SSH login without password in Linux

13th May, 2017 · techinf1 1 Comment

For many reasons we need to access remote server automatically without providing password. Specially when you need to copy file through script or programming from one server to another server. We know that SSH is a secure protocol to access remote server. Here we will show how we can access remote server without providing password.  We have two servers: cgvm01 and cgvm02 ; and we will automatically login from cgvm01 to cgvm02.

Step 1: Create key

[[email protected] ~]# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:

When you will be asked to enter passpharase keep it blank.

Step 2: Copy Key to remote host

[[email protected] ~]# ssh-copy-id [email protected]
/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
[email protected]’s password:

Number of key(s) added: 1

Now try logging into the machine, with: “ssh ‘[email protected]′”
and check to make sure that only the key(s) you wanted were added.

Here cgvm01 is the remote host.  You need to provide its password against the provided user.

Step 3: login to remote host

[[email protected] cluster]# ssh [email protected]
Last login: Tue Sep 20 15:38:42 2016 from 192.168.8.82

You don’t need to provide password any more.

 

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)

Related

Posted in Uncategorized |
« How to write automated FTP script in Linux
Recover MySQL 5.7 root Password in Redhat/CentOS 7 »

One thought on “SSH login without password in Linux”

  1. bijoy says:
    November 16, 2017 at 5:57 pm

    Nice post on this comment thnak you so much

    Reply

Leave a Reply Cancel reply

Android App to challenge math ability
MathQuiz

Top Posts

  • Optimize MySQL tmp_table_size
  • Optimize MySQL table_open_cache
  • Sum Column in Linux
  • fixing mysql replication error automatically

Recent Posts

  • Recover MySQL 5.7 root Password in Redhat/CentOS 7
  • SSH login without password in Linux
  • How to write automated FTP script in Linux
  • Installing Nginx with PHP support
  • How to access HTML5 local storage

Follow US

Follow US

Categories

© Techinfobest is the house of tech articles
  • About
  • aStore
  • Contact Info
  • google pagerank checker
  • SEO Keyword Rank
  • SEO Page Audit
  • Tools
  • whois