美文网首页
ssh-keygen的简单使用

ssh-keygen的简单使用

作者: dotdiw | 来源:发表于2016-06-08 16:33 被阅读135次

1.输入以下命令:

# ssh-keygen -t rsa

2.输入命令ls会看见两个文件公钥私钥

# ls

id_rsa.pub & id_rsa.pub

3.复制id_rsa.pub,并命名为authorized_keys

# cp id_rsa.pub authorized_keys

4.验证是否成功

# ssh localhost

如果成功:

The authenticity of host 'localhost (::1)' can't be established.

RSA key fingerprint is07:07:8e:1c:c0:7e:7f:1f:ca:6a:e6:d3:cb:7f:b7:a1.

 Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added 'localhost' (RSA) to the list of known hosts.

5.将公钥复制到远程服务器

# scp ~/.ssh/id_rsa.pub 远程用户名@远程服务器ip:~/

6.追加公钥到授权key中

# cat ~/id_rsa.pub >> ~/.ssh/authorized_keys

7.保险起见,删除公钥

# rm ~/id_rsa.pub

相关文章

  • ssh-keygen的简单使用

    1.输入以下命令: # ssh-keygen -t rsa 2.输入命令ls会看见两个文件公钥私钥 # ls 3....

  • SSH-Keygen的使用

    SSH-Keygen的使用 昨天大致整理了下关于ssh连接服务器的文档,当时遇到了关于密钥的问题,今天便整理了关于...

  • 生成.ssh公钥

    生成ssh公钥使用指令$ ssh-keygen或者$ ssh-keygen -t rsaSSH 公钥默认储存在账户...

  • Linux配置git连接

    1:#生成本地key ssh-keygen -t rsa (也可以只使用ssh-keygen) 2:#查看生成的k...

  • Linux免密登录配置

    1、在可免密登录的主机A生成密钥信息: ssh-keygen #使用 ssh-keygen 命令,一直按回车,就可...

  • Linux配置远程ssh无密码登录

    原理 很简单,使用ssh-keygen 在主机A上生成公钥和密钥,将生成的公钥拷贝到远程机器主机B上后,就可以使用...

  • 生产KEY

    1.使用ssh-keygen生成私钥和公钥 命令如下: ssh-keygen -t rsa 1 例子: ssh-k...

  • ssh-keygen 简单创建密钥

    1. 生成密钥 2. 查看公钥

  • 阿里云服务器配置ssh免密登录

    在本机中使用ssh-keygen生成RSA密钥和公钥(如果已生成密钥可跳过此步骤)ssh-keygen -t rs...

  • linux服务器免密登录(sshken秘钥)

    1 使用ssh-keygen生成密匙ssh-keygen在本地生成公钥和私钥。(可以设置一个秘钥,或者直接回车) ...

网友评论

      本文标题:ssh-keygen的简单使用

      本文链接:https://www.haomeiwen.com/subject/jayjdttx.html