AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / unix / Perguntas / 416603
Accepted
Daniele
Daniele
Asked: 2018-01-13 06:55:27 +0800 CST2018-01-13 06:55:27 +0800 CST 2018-01-13 06:55:27 +0800 CST

Para que serve a opção -I certificate_identity ssh-keygen?

  • 772

Estou seguindo este tutorial para validar um servidor SSH, em teoria devo usar uma chave privada fornecida por um servidor de autoria para assinar a chave SSH pub, mas não entendo o papel da -I <key_id>opção e qual valor ela deve ter:

ssh-keygen -s server_ca -I host_sshserver -h -n sshserver.example.com /etc/ssh/ssh_host_rsa_key.pub

Desde já, obrigado.

openssh
  • 1 1 respostas
  • 1383 Views

1 respostas

  • Voted
  1. Best Answer
    George Udosen
    2018-01-13T07:56:54+08:002018-01-13T07:56:54+08:00

    Trechos de man ssh-keygen:

    -I certificate_identity
                 Specify the key identity when signing a public key.  Please see the CERTIFICATES section for details.
    
    CERTIFICATES
         ssh-keygen supports signing of keys to produce certificates that may be used for user or host authentication.  Certificates consist of a public key, some
         identity information, zero or more principal (user or host) names and a set of options that are signed by a Certification Authority (CA) key.  Clients or
         servers may then trust only the CA key and verify its signature on a certificate rather than trusting many user/host keys.  Note that OpenSSH certifi‐
         cates are a different, and much simpler, format to the X.509 certificates used in ssl(8).
    
         ssh-keygen supports two types of certificates: user and host.  User certificates authenticate users to servers, whereas host certificates authenticate
         server hosts to users.  To generate a user certificate:
    
               $ ssh-keygen -s /path/to/ca_key -I key_id /path/to/user_key.pub
    
         The resultant certificate will be placed in /path/to/user_key-cert.pub.  A host certificate requires the -h option:
    
               $ ssh-keygen -s /path/to/ca_key -I key_id -h /path/to/host_key.pub
    
         The host certificate will be output to /path/to/host_key-cert.pub.
    
         It is possible to sign using a CA key stored in a PKCS#11 token by providing the token library using -D and identifying the CA key by providing its pub‐
         lic half as an argument to -s:
    
               $ ssh-keygen -s ca_key.pub -D libpkcs11.so -I key_id user_key.pub
    
         In all cases, key_id is a "key identifier" that is logged by the server when the certificate is used for authentication.
    
         Certificates may be limited to be valid for a set of principal (user/host) names.  By default, generated certificates are valid for all users or hosts.
         To generate a certificate for a specified set of principals:
    
               $ ssh-keygen -s ca_key -I key_id -n user1,user2 user_key.pub
               $ ssh-keygen -s ca_key -I key_id -h -n host.domain host_key.pub
    
         Additional limitations on the validity and use of user certificates may be specified through certificate options.  A certificate option may disable fea‐
         tures of the SSH session, may be valid only when presented from particular source addresses or may force the use of a specific command.  For a list of
         valid certificate options, see the documentation for the -O option above.
    
         Finally, certificates may be defined with a validity lifetime.  The -V option allows specification of certificate start and end times.  A certificate
         that is presented at a time outside this range will not be considered valid.  By default, certificates are valid from UNIX Epoch to the distant future.
    
         For certificates to be used for user or host authentication, the CA public key must be trusted by sshd(8) or ssh(1).  Please refer to those manual pages
         for details.
    

    Observação:

    Em todos os casos, key_id é um "identificador de chave" registrado pelo servidor quando o certificado é usado para autenticação.

    E do seu link afirma:

    -I: Este é um nome que é usado para identificar o certificado. Ele é usado para fins de registro quando o certificado é usado para autenticação.

    Ao usar certificados para autenticação, estes possuem chaves para identificar o certificado de autenticação específico. Isso recebe qualquer nome que você queira que eu possa chamar de meu my-new-cert-ide o certificado será criado com ele ide usado para acessar meu certificado de autenticação.

    Observe que nesse link você forneceu dois -Inomes diferentes, então escolha aquele que você gosta.

    Papel de -I: ssh-keygen suporta assinatura de chaves para produzir certificados que podem ser usados ​​para autenticação de usuário ou host. Usado quando você precisa usar certificados para autenticação.

    Valor de -I: : Qualquer nome de sua preferência

    • 3

relate perguntas

  • Gerar nome hash para SSH known_hosts

  • Não é possível conectar-se ao Centos 6.9 após a atualização para o OpenSSH 7.6 neste servidor [duplicado]

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Como exportar uma chave privada GPG e uma chave pública para um arquivo

    • 4 respostas
  • Marko Smith

    ssh Não é possível negociar: "nenhuma cifra correspondente encontrada", está rejeitando o cbc

    • 4 respostas
  • Marko Smith

    Como podemos executar um comando armazenado em uma variável?

    • 5 respostas
  • Marko Smith

    Como configurar o systemd-resolved e o systemd-networkd para usar o servidor DNS local para resolver domínios locais e o servidor DNS remoto para domínios remotos?

    • 3 respostas
  • Marko Smith

    Como descarregar o módulo do kernel 'nvidia-drm'?

    • 13 respostas
  • Marko Smith

    apt-get update error no Kali Linux após a atualização do dist [duplicado]

    • 2 respostas
  • Marko Smith

    Como ver as últimas linhas x do log de serviço systemctl

    • 5 respostas
  • Marko Smith

    Nano - pule para o final do arquivo

    • 8 respostas
  • Marko Smith

    erro grub: você precisa carregar o kernel primeiro

    • 4 respostas
  • Marko Smith

    Como baixar o pacote não instalá-lo com o comando apt-get?

    • 7 respostas
  • Martin Hope
    rocky Como exportar uma chave privada GPG e uma chave pública para um arquivo 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Wong Jia Hau ssh-add retorna com: "Erro ao conectar ao agente: nenhum arquivo ou diretório" 2018-08-24 23:28:13 +0800 CST
  • Martin Hope
    Evan Carroll status systemctl mostra: "Estado: degradado" 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim Como podemos executar um comando armazenado em uma variável? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S Por que /dev/null é um arquivo? Por que sua função não é implementada como um programa simples? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 Como ver as últimas linhas x do log de serviço systemctl 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - pule para o final do arquivo 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla Por que verdadeiro e falso são tão grandes? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis Substitua a string em um arquivo de texto enorme (70 GB), uma linha 2017-12-30 06:58:33 +0800 CST
  • Martin Hope
    Bagas Sanjaya Por que o Linux usa LF como caractere de nova linha? 2017-12-20 05:48:21 +0800 CST

Hot tag

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve