查看: 1895|回复: 1
打印 上一主题 下一主题

SSH Keys

[复制链接]
  • TA的每日心情
    开心
    2016-5-12 14:23
  • 签到天数: 2 天

    [LV.1]初来乍到

    跳转到指定楼层
    楼主
    发表于 2014-9-2 15:08:46 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
    SSH 密钥对可以让您方便的登录到 SSH 服务器,而无需输入密码。由于您无需发送您的密码到网络中,SSH 密钥对被认为是更加安全的方式。再加上使用密码短语 (passphrase) 的使用,安全性会更上一层楼。
    7 C# R: ^& ]& i$ z
    3 n' G# G+ u5 q5 M5 Z$ l+ ?同时,我们可以使用 SSH agent 来帮助我们记住密码短语,无需我们记住没一个密钥对的密码短语,减轻了我们的负担。
    8 r+ Y2 Y2 ^6 s( Y9 F, `. O6 _; V$ P, A) y, T$ T
    2 M0 _# y$ x# q6 ]- h
    我们可以使用 ssh-keygen 命令生成密钥对 - q' G9 p7 q+ S' ^/ F& m& S
    $ ssh-keygen -t ecdsa -b 521 -C "$(whoami)@$(hostname)-$(date -I)"
    8 h) ~7 r  D% [3 P% Z5 @8 k  D' x3 L: @6 Z! Z6 l/ d+ @
    Generating public/private ecdsa key pair.% C9 s! }% i7 r, N" e9 G8 l
    Enter file in which to save the key (/home/username/.ssh/id_ecdsa):
    + p; X) F+ o: I* ^Enter passphrase (empty for no passphrase):
    ' E3 y9 i5 V$ w& }* p3 u- SEnter same passphrase again:
    ' B! \9 `3 c3 w3 {' F' ]2 oYour identification has been saved in /home/username/.ssh/id_ecdsa.7 s# s3 {( k% r! k: o5 d
    Your public key has been saved in /home/username/.ssh/id_ecdsa.pub.2 |% J+ D7 n$ \! W) T3 q
    The key fingerprint is:; p/ [0 A, a2 e5 x5 j
    dd:15:ee:24:20:14:11:01:b8:72:a2:0f:99:4c:79:7f username@localhost-2011-12-220 w( n; h- h0 V. p
    The key's randomart image is:: s. n  x& U' |
    +--[ECDSA  521]---+
    & Z2 ~5 y( C# g$ @$ }|     ..oB=.   .  |
    / C2 o0 _( j; y|    .    . . . . |
    0 H* B. k3 _/ m/ ~+ }|  .  .      . +  |' j+ M. `! k& u$ ~: K, Q( |
    | oo.o    . . =   |
    4 X3 @. v/ ^0 j& }9 N" y|o+.+.   S . . .  |" F% F; v! O0 j% \' [
    |=.   . E         |3 B. A, e9 T! c$ }- j4 ?4 f4 `
    | o    .          |: y% w0 }$ u2 g# W+ ~
    |  .              |
    # X% f2 n( M8 V# j8 [' U4 j|                 |
    ) g$ L, i+ ~0 n3 Y2 s/ T+-----------------+
    ( R! R+ }4 P( O' X1 h: k: {
    - L$ \& X4 ?: ]9 x' T, a; q' M- j在上面这个例子中,ssh-keygen 生成了一对长度为 512 bit (-b 512) 的 ECDSA (-t ecdsa) 加密的密钥对,comment 为 -C "$(whoami)@$(hostname)-$(date -I)"。而 randomart image 是 OpenSSH 5.1 引入的一种简单的识别指纹 (fingerprint) 的图像。
    9 r8 [/ N1 k4 D5 d9 _- j6 b
    4 F  b7 ?( l& ]: K( m. r1 d* f! l2 N( v0 [& v. r
    ...... please refer to the URL: https://wiki.archlinux.org/index.php/SSH_Keys_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)
    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
    收藏收藏
    回复

    使用道具 举报

  • TA的每日心情
    开心
    2016-5-12 14:23
  • 签到天数: 2 天

    [LV.1]初来乍到

    沙发
     楼主| 发表于 2014-9-3 14:55:30 | 只看该作者
    For Windows login to the remote system with SSH and key.  Please refer to the following URL:5 c- M" H1 @9 a3 P, E4 J
    7 `" U  h7 Q/ R& }& l
    http://www.howtoforge.com/ssh_key_based_logins_putty_p2
    回复 支持 反对

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    小黑屋|Archiver|手机版|香港易事泊讨论区论坛 - bbs.hkesp.com    

    © 2001-2013 Comsenz Inc.All Rights Reserved.

    Powered by Discuz! X3.2

    快速回复 返回顶部 返回列表