Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does it work with SSH Agent? #769

Open
ybushev opened this issue Mar 12, 2022 · 2 comments
Open

Does it work with SSH Agent? #769

ybushev opened this issue Mar 12, 2022 · 2 comments

Comments

@ybushev
Copy link

ybushev commented Mar 12, 2022

Hey, I'm trying to clone project from GitHub using ssh agent authentication:

execSync(`ssh-agent -s -a "/tmp/ssh-agent.socket"`, { uid: UID })

export const GitClient = simpleGit({
  baseDir: USER_DIRECTORY,
  spawnOptions: {
    uid: UID
  }
}).env('SSH_AUTH_SOCK', '/tmp/ssh-agent.socket');

But got the error:

message: "Cloning into '/home/user/test_pub_10'...
Warning: Permanently added the RSA host key for IP address '140.82.113.4' to the list of known hosts.
Load key "/home/user/.ssh/id_rsa": invalid format
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists."

When I'm trying to run the git client from a console using the same user it's working great:

[web]$ ssh -T git@github.com
Hi ybushev! You've successfully authenticated, but GitHub does not provide shell access.

What I missed? Thanks!

@ybushev ybushev changed the title Does it working with SSH Agent? Does it work with SSH Agent? Mar 12, 2022
@stepjacky
Copy link

by the way .another question. how to do same things on windows

@danikane
Copy link

by the way .another question. how to do same things on windows

Better use WSL for your development workflows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants