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-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/代表加密完成

  • 分发密钥

    scp USERNAME@---.---.---.---:/home/USERNAME/.ssh/id_rsa ~/.ssh/

以上是 sshd_key认证 的全部内容, 来源链接: utcz.com/z/513159.html

回到顶部