Linuxssh key login

Source: Internet
Author: User
Install OpenSSh. Generally, the linux system has [root @ sqzr ~] The ssh-keygen-b1024-trsaGeneratingpublicprivatersakeypair prompts that an rsa key pair is being generated for Enterfileinwhichtosavethekey (ro
  1. Install OpenSSh.

    [Root @ sqzr ~] # Ssh-keygen-B 1024-t rsa
    Generating public/private rsa key pair. # the system prompts that an rsa key pair is being generated.
    Enter file in which to save the key (/root/. ssh/id_dsa)
    Enter passphrase (empty for no passphrase): # Enter the private key secret and Enter the secret
    Enter same passphrase again: # prompt again for entering the password for confirmation
    Your identification has been saved in/root/. ssh/id_dsa. # the system prompts that the public key and private key are already stored in the/root/. ssh/directory.
    Your public key has been saved in/root/. ssh/id_dsa.pub.
    The key fingerprint is:
    X6: 68: xx: 93: 98: 8x: 87: 95: 7x: 2x: 4x: x9: 81: xx: 56: 94 root @ server # key fingerprint prompt

  2. After the file is generated, save the/root/. ssh/id_dsa file to the local device through WinSCP.
  3. Download puttygen.exe (see the end of the article), save it to the local id_dsa import, and enter the private key secret language entered during generation.

  4. After the import is successful, save the public key and write the content of the public key ~ /. Ssh/authorized_keys

  5. Save the private key with the suffix ppk and disable linux password logon (only private key logon is allowed)

    Modify the/etc/ssh/sshd_config file
    Change PasswordAuthentication yes to PasswordAuthentication no, and restart ssh
    Import private keys in putty

    If you do not need to use a private key to log on again, you can enter the password of the private key, even if the private key file is obtained by someone else, no one else can know which server the private key file belongs to or get the private key password.

    Tools:

    Puttygen Official Download link: http://the.earth.li /~ Sgtatham/putty/latest/x86/puttygen.exe
    Putty Official Download link: http://the.earth.li /~ Sgtatham/putty/latest/x86/putty.exe

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.