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

lit auth "No private key" #261

Open
natnat-mc opened this issue Jul 6, 2019 · 4 comments
Open

lit auth "No private key" #261

natnat-mc opened this issue Jul 6, 2019 · 4 comments

Comments

@natnat-mc
Copy link

I'm trying to authenticate myself with lit to publish a module, but lit auth tells me that I don't have a public key.

~/g/lit-jsonstream> lit auth [username]
lit version: 3.7.3
luvi version: v2.9.3
command: auth [username]
load config: /home/[machine username]/.litconfig
username: [username]
name: [my name]
email: [my email]
privateKey: /home/[machine username]/.ssh/id_rsa
fail: [string "bundle:libs/core.lua"]:357: No private key
stack traceback:
        [C]: in function 'assert'
        [string "bundle:libs/core.lua"]:357: in function 'authUser'
        [string "bundle:commands/auth.lua"]:63: in function <[string "bundle:commands/auth.lua"]:1>
        [string "bundle:main.lua"]:69: in function <[string "bundle:main.lua"]:56>
        [C]: in function 'xpcall'
        [string "bundle:main.lua"]:56: in function <[string "bundle:main.lua"]:48>

Except that I do have a private key at /home/[machine username]/.ssh/id_rsa, which I use to push to GitHub.

~/g/lit-jsonstream> wc -l /home/[machine username]/.ssh/id_rsa
27 /home/[machine username]/.ssh/id_rsa

I have recently reinstalled my machine and changed RSA keys, and it worked before, if this is relevant.

@catinsurance
Copy link

I'm having this same issue a year later! Really hoping someone can look into this.

squeek502 pushed a commit to squeek502/lit that referenced this issue Aug 11, 2020
squeek502 added a commit to squeek502/lit that referenced this issue Aug 11, 2020
@squeek502
Copy link
Member

OpenSSL is erroring when reading the key, but lit is just outputting a generic error instead of the actual reason. #275 should help.

@Bilal2453
Copy link
Contributor

Bilal2453 commented Jun 24, 2021

@maya-bee Make sure your key uses PEM, nothing else.
For example, when generating your key using ssh keygen you would do something such as:

keygen -t rsa -b 4096 -C "[email protected]" -m PEM

the -m PEM will tell it to not use whatever other default is.
Your id_rsa file header should look like this

-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: AES-128-CBC,59A8A5

LONG_HASH_HERE
-----END RSA PRIVATE KEY-----

I've been running into this recently and just regenerating my key forcing PEM formatting fixed it.

@creationix
Copy link
Member

I hit the same issue today. I guess ssh-keygen doesn't default to the format that openssl supports anymore on ubuntu.

I can confirm that generating the key with ssh-keygen -m PEM worked for me after I uploaded the new public key to github.

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

5 participants