zoukankan      html  css  js  c++  java
  • ssh 公钥认证

    [grid @busrac1~]$ ssh-keygen -t rsa		//一路回车
    [grid @busrac1~]$ ssh-keygen -t dsa
    [grid @busrac1~]$ cd .ssh
    [grid @busrac1.ssh]$ cat *.pub >authorized_keys
    
    
    [oracle@oadb ~]$  ssh-keygen -t rsa
    Generating public/private rsa key pair.
    Enter file in which to save the key (/home/oracle/.ssh/id_rsa): 
    Created directory '/home/oracle/.ssh'.
    Enter passphrase (empty for no passphrase): 
    Enter same passphrase again: 
    Your identification has been saved in /home/oracle/.ssh/id_rsa.
    Your public key has been saved in /home/oracle/.ssh/id_rsa.pub.
    The key fingerprint is:
    ef:6a:a8:00:71:54:bc:cd:38:bc:e9:cf:ab:b7:bb:32 oracle@oadb
    The key's randomart image is:
    +--[ RSA 2048]----+
    |  .o.            |
    | .  .            |
    |. .. =           |
    | o  = o          |
    |.    +  S        |
    | .  o    .       |
    |  ..   .  .      |
    |   .E.o ..       |
    |    oBB*...      |
    +-----------------+
    [oracle@oadb ~]$ 
    [oracle@oadb ~]$ cd .ssh/
    [oracle@oadb .ssh]$ ls
    id_rsa  id_rsa.pub
    
    [oracle@oadb ~]$ ssh-keygen -t dsa
    Generating public/private dsa key pair.
    Enter file in which to save the key (/home/oracle/.ssh/id_dsa): 
    Enter passphrase (empty for no passphrase): 
    Enter same passphrase again: 
    Your identification has been saved in /home/oracle/.ssh/id_dsa.
    Your public key has been saved in /home/oracle/.ssh/id_dsa.pub.
    The key fingerprint is:
    46:58:d0:10:41:d4:2e:c1:1e:8a:f1:e8:26:b2:36:c7 oracle@oadb
    The key's randomart image is:
    +--[ DSA 1024]----+
    |     +BB.        |
    |  .   +oo        |
    |   = o.+.        |
    |  o o o..        |
    | .     .S        |
    |o o    .         |
    |.+.              |
    |.o E             |
    |. o              |
    +-----------------+
    [oracle@oadb ~]$ cd .ssh/
    [oracle@oadb .ssh]$ ls
    id_dsa  id_dsa.pub  id_rsa  id_rsa.pub
    [oracle@oadb .ssh]$ ls -ltr
    total 16
    -rw-r--r-- 1 oracle dba  393 May 13 13:23 id_rsa.pub
    -rw------- 1 oracle dba 1675 May 13 13:23 id_rsa
    -rw-r--r-- 1 oracle dba  601 May 13 13:24 id_dsa.pub
    -rw------- 1 oracle dba  668 May 13 13:24 id_dsa
    [oracle@oadb .ssh]$ 
    
     ssh-keygen -t rsa	 生成id_rsa  id_rsa.pub
     
      ssh-keygen -t dsa  生成id_dsa  id_dsa.pub
      
      cat *.pub >authorized_keys
      
      公钥其实就是id_rsa.pub
      
      
      公匙是被放在 ~/.ssh/authorized_keys 这个文件中
      
      
      id_rsa叫私钥,也就是钥匙,id_rsa.pub叫公钥。


    
                                        
    
  • 相关阅读:
    我所遭遇过的游戏中间件---HumanIK
    我所遭遇过的游戏中间件--Kynapse
    3D屏保:排色榜
    3维DEMO: 抽奖圆盘
    MySQL存储过程中的3种循环
    MyISAM与InnoDB两者之间区别与选择,详细总结,性能对比
    如何执行字符串的PHP代码
    PHP 注册错误和异常处理机制
    Mysql表中唯一编号的分配机制
    装系统w7、ubuntu、centos等系统(一)
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13349751.html
Copyright © 2011-2022 走看看