Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

206
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!