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/

https://www.cnblogs.com/abua/archive/2020/02/03/12257136.html

「点点赞赏,手留余香」

    还没有人赞赏,快来当第一个赞赏的人吧!
0 条回复 A 作者 M 管理员
    所有的伟大,都源于一个勇敢的开始!
欢迎您,新朋友,感谢参与互动!欢迎您 {{author}},您在本站有{{commentsCount}}条评论