Announcement Announcement Module
No announcement yet.
SSH Passwordless Login Using SSH Keygen Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • SSH Passwordless Login Using SSH Keygen

    Secure Shell (SSH) is a crytographic network protocol for secure data communication,remote command-line login, remote command execution, and other secure network services between two networked computers. it connects, via secure channel over an insecure network, a server and a client running SSH server and SSH client programs, respectively.Below are the steps for SSH password-less automatic login from server on server to other.

    login from as root to 192.3168.1.2 with user xyz

    step 1:

    First login into server with user root and generate a pair of public keys using the keygen command.

    [root@ ~]$ ssh-keygen -t rsa

    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:
    Your identification has been saved in /root/.ssh/id_rsa.
    Your public key has been saved in /root/.ssh/
    The key fingerprint is:
    20:40:92:6d:2d:a0:d2:c9:63:83:20:74:88:67:54:f9 root@
    The key's randomart image is:
    +--[ RSA 2048]----+
    |BB=+.. |
    |**Boo |
    |++B.... |
    |.. o .E. |
    | S |
    | |
    | |
    | |
    | |

    step 2:

    Create a .ssh directory on

    [root@ ~]$ ssh xyz@ mkdir -p .ssh

    step 3:

    Use SSH from server and upload new generated public key ( on server under xys ‘s .ssh directory as a file name authorized_keys.

    [root@ ~]$ cat .ssh/ | ssh xyz@ 'cat >> .ssh/authorized_keys'

    xyz@'s password: [Enter Your Password ]

    step 4:

    Change permissions on There are different ssh versions on servers so we need to change the permissions on .ssh directory and authorized_keys file.

    [root@ ~]$ ssh xyz@ "chmod 700 .ssh; chmod 640 .ssh/authorized_keys"

    step 5:

    Try login without passwords

    [root@ ~]$ ssh xyz@

Tag Cloud Tag Cloud Module