Quick example of connecting with publicKey?

Open
#420 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
30/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript

Research direction

Start by reviewing the node-ssh authentication documentation and the SSH2 authentication options referenced by the publicKey and privateKey examples. Determine whether publicKey-only authentication is supported, then document the correct configuration or clearly state the limitation, including the authentication failure shown in the issue.

Written by the indexing model from the issue text.

Description

Hi, I've seen that there is another similar question, but I still hope you as the creator of this very useful tool can help.

Basically I'm creating a small tool which would allow me to connect to my servers using one or another SSH key, and do some minot things there (file read/write).

While it's pretty obvious how to connect with a privateKey, and it works well, I see nowhere any docs on publicKey.

I've tried simply replacing privateKey with publicKey, but it seems like it's ignoring it.

Fails with: error {"level":"client-authentication"} Error: All configured authentication methods failed

So, do you have any quick tips maybe, if it's possible to easily tell ssh to use public key instead of private key? I mean, not sure if it should make a big difference...

Dominant language
TypeScript
Stars
1k
Forks
94
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from steelbrain/node-ssh

All issues in steelbrain/node-ssh

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.