question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question: Auth with SSH Agent

See original GitHub issue

Can you provide an example of authentication with an SSH agent?

I’m having trouble getting it working, persistently getting:

Connection :: connect
Connection :: error :: Error: Authentication failure. Available authentication methods: undefined
Connection :: close

I’m providing the path to the SSH Agent socket, and other details:

c.connect({
  host: 'some-server.com',
  port: 22,
  username: 'me',
  agent: "/path/to/agent/socket",
});

Platform is OSX (perhaps this isn’t supported?) node.js 0.8.18

Any suggestions/help would be appreciated!

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
aleksfescommented, Sep 29, 2014

mscdex, kuleszaj, thanks!

I wanted to use agent forwarding but every time got error: { [Error: Authentication failure. Available authentication methods: publickey,password] level: ‘authentication’, partial: false }

This work for me:

var sshAuthSocket = process.env.SSH_AUTH_SOCK;
var conn = new Connection();
conn.connect({
  host: 'my-host',
  username: 'my-username',
  agent: sshAuthSocket
});
0reactions
kuleszajcommented, Jun 6, 2013

I found the problem.

I was not properly initializing the SSH agent from within tmux. I forgot that tmux is detached from the normal user-space, and so some access (e.g. SSH agent) needs to be re-initialized from within tmux.

Thank you very much for your suggestions – they led me to digging into what ultimately ended up being the answer.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The pitfalls of using ssh-agent, or how to use an agent safely
Too many keys, github, and friends​​ One thing to keep in mind is that when you try to login into a remote host,...
Read more >
Why am I still getting a password prompt with ssh with public ...
When I first set up my ssh key auth, I didn't have the ~/.ssh folder ... Our problem was that login worked from...
Read more >
Could not open a connection to your authentication agent
See the following answers: ssh-add complains: Could not open a connection to your authentication agent.
Read more >
Some questions regarding SSH key authentication - Super User
As the title says, I have some questions regarding SSH key authentication method on a Linux machine. First of all, I generated my...
Read more >
Connect to your Git repos with SSH - Azure - Microsoft Learn
How SSH key authentication works; Set up SSH key authentication; Questions and troubleshooting. Azure DevOps Services | Azure DevOps Server ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found