Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

204
Visualizações
How to get a server's host key using JavaScript in the browser?

Given the hostname of a server, I want to get its Host/Public key (stored in /etc/ssh/) using JavaScript in the browser.

I am aware that in the command line, we can get a host key using the ssh-keyscan utility. I want to do the same thing using JS (preferably vanilla JS).

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

A Node.js script could probably do it a few different ways.

  • it could execute the same ssh-keyscan command a human would use, via the built-in child_process module

You would capture the content of stdout and stderr as strings, and then parse those strings manually.

  • if the data you want can be read directly from a file, you could use the file module to read the file contents as a string, which you would then parse manually

Both of those will work using vanilla JS, and would not require that you install any third-party modules.

Note that Node might need special permissions. You might not encounter that difficulty running this on your local workstation, as yourself, but in a security-conscious environment it will probably require special steps.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda