zoukankan      html  css  js  c++  java
  • SFTP 利用对称公钥免密码的方法

    在客户端的操作:

    #cd .ssh             进入.ssh目录

    #ssh-keygen -t rsa   执行创建密钥对命令

    Generating public/private rsa key pair.

    Please be patient....   Key generation may take a few minutes

    Enter file in which to save the key (/home/ap/appnms/.ssh/id_rsa):

    # 按回车保存为: //.ssh/id_rsa,即当前用户的私钥

    Enter passphrase (empty for no passphrase):

    # 按回车,表示读取密钥时不需要密钥的密码

    Enter same passphrase again:

    # 确认密钥的密码,必须和上面的输入相同

    Your identification has been saved in /home/ap/appnms/.ssh/id_rsa.

    # 私钥保存信息

    Your public key has been saved in /home/ap/appnms/.ssh/id_rsa.pub.

    # 公钥保存信息

    The key fingerprint is:

    31:03:78:64:4f:8e:9d:a9:31:bf:38:5d:1a:79:08:e6 appnms@T254N0V4

    # 密钥指纹

    The key's randomart image is:

    +--[ RSA 2048]----+

    |     o+ .        |

    |    ...B o       |

    |     .* X        |

    |     o * *       |

    |      E S o      |

    |       o *       |

    |      o +        |

    |       .         |

    |                 |

    +-----------------+

    在服务端的操作:

    把.ssh目录下的公钥文件:/当前用户home目录/.ssh/id_rsa.pub文件传输到服务器上。

    如果有多个客户端,依次将客户端公钥附加到服务器的authorized_keys文件内即可。

    # cat /tmp/id_rsa.pub >> authorized_keys

  • 相关阅读:
    浏览器 窗口 scrollTop 的兼容性问题
    document.documentElement.scrollTop || document.body.scrollTop;
    javascript函数querySelector
    :before和:after的内幕以及伪类
    css伪类伪元素
    JavaScript 运动框架 Step by step
    js中style,currentStyle和getComputedStyle的区别
    js函数变量
    函数
    oracle语法练习
  • 原文地址:https://www.cnblogs.com/kiddy/p/6673680.html
Copyright © 2011-2022 走看看