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叫公钥。


    
                                        
    
  • 相关阅读:
    算法题
    AIO和NIO的理解
    Redis面试考点
    对MVVM的理解
    Vuex状态管理模式
    vue 的computed 和 watch 两者的区别
    vue之组件通信
    vue生命周期钩子函数
    angularjs 运行时报错ERROR in node_modules/rxjs/internal/types.d.ts(81,44): error TS1005: ';' expected. node_modules/rxjs/internal/types.d.ts(81,74): error TS1005: ';' expected. node_modules/rxjs/internal/t
    浅入不深出--vuex的简单使用
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13349751.html
Copyright © 2011-2022 走看看