Qual é o significado de -i em ssh?

Qual é o significado de -i em ssh?

O que a -itag adiciona a um comando como:

ssh -i path-to-pem-file ubuntu@ip-address

Responder1

Na página de manual:

-i identity_file
             Selects a file from which the identity (private key) for public
             key authentication is read.  The default is ~/.ssh/identity for
             protocol version 1, and ~/.ssh/id_dsa, ~/.ssh/id_ecdsa,
             ~/.ssh/id_ed25519 and ~/.ssh/id_rsa for protocol version 2.
             Identity files may also be specified on a per-host basis in the 
             configuration file.  It is possible to have multiple -i options
             (and multiple identities specified in configuration files).  
             If no certificates have been explicitly specified by the
             CertificateFile directive, ssh will also try to load certificate 
             information from the filename obtained by appending -cert.pub to 
             identity filenames.

Basicamente, ele diz ao comando SSH para examinar o arquivo de chave necessário para autenticação no servidor de destino. Se você usa autenticação de chave e recebeu um certificado, é aqui que você deseja especificá-lo. Se você usar autenticação de senha normal, ignore essa opção.

Além disso, para o futuro, será mais fácil pesquisar coisas como esta no Google. Você gastará menos esforço e obterá uma resposta mais rapidamente.

Responder2

Depágina de manual

-i arquivo_identidade

   Selects a file from which the identity (private key) for public
   key authentication is read.  The default is ~/.ssh/identity for
   protocol version 1, and ~/.ssh/id_dsa, ~/.ssh/id_ecdsa,
   ~/.ssh/id_ed25519 and ~/.ssh/id_rsa for protocol version 2.
   Identity files may also be specified on a per-host basis in the
   configuration file.  It is possible to have multiple -i options
   (and multiple identities specified in configuration files).  If
   no certificates have been explicitly specified by the
   CertificateFile directive, ssh will also try to load certificate
   information from the filename obtained by appending -cert.pub to
   identity filenames.

informação relacionada