Skip to content

Instantly share code, notes, and snippets.

@8ctopotamus
Created March 15, 2018 21:21
Show Gist options
  • Save 8ctopotamus/d45cd30f8303a90b21a7ca3c6313d3d8 to your computer and use it in GitHub Desktop.
Save 8ctopotamus/d45cd30f8303a90b21a7ca3c6313d3d8 to your computer and use it in GitHub Desktop.
Generate an SSH key to fix 'could not read Username for 'https://github.com': Invalid argument'

Source: hexojs/hexo-deployer-git#71

error: failed to execute prompt script (exit code 1) fatal: could not read Username for 'https://github.com': Invalid argument

1- Create a ssh key using Git Bash using following command

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

After running this command just install the by default options and enter the password balnk when it prompts.

2- Then run the following commands to locate the public/private key generated from step1

cd .ssh

cd ~/.ssh

3- Then run the following command to view your public:

cat id_rsa.pub

4- Copy your public key and go to your GitHub account -> settings -> create a SSH and GPG keys then click new ssh key and past your public key in the in key text field.

5- Verify your public key using Git Bash by running the following command:

ssh -vT [email protected]

You will get output like this

debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 3848, received 2040 bytes, in 0.2 seconds
Bytes per second: sent 16032.4, received 8499.5
debug1: Exit status 1

Then you no longer got "could not read Username for 'https://github.com': Invalid argument"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment