sshd_key認證

# info
# CentOS 7.3 64位
  • 生成認證key服務器

    ssh-keygen
    Generating public/private rsa key pair.
    # 指定保存加密字符的文件(使用默認)
    Enter file in which to save the key 
    Created directory '/home/USERNAME/.ssh'.
    # 設定密碼(使用默認空密碼)
    Enter passphrase (empty for no passphrase):
    # 確認密碼
    Enter same passphrase again:
    Your identification has been saved in /home/USERNAME/.ssh/id_rsa.
    Your public key has been saved in /home/USERNAME/.ssh/id_rsa.pub.
    The key fingerprint is:
    ※※※
    /home/USERNAME/.ssh/id_rsa私鑰(鑰匙)
    /home/USERNAME/.ssh/id_rsa.pub公鑰(鎖)
  • 加密服務器ssh

    ssh-copy-id -i /home/USERNAME/.ssh/id_rsa.pub USERNAME@---.---.---.---
    Now try logging into the machine, with:   "ssh 'USERNAME@---.---.---.---'"
    and check to make sure that only the key(s) you wanted were added.
    authorized_keys存在於/home/USERNAME/.ssh/表明加密完成
  • 分發密鑰ide

    scp USERNAME@---.---.---.---:/home/USERNAME/.ssh/id_rsa ~/.ssh/
相關文章
相關標籤/搜索