Skip to content

Why can I pull ssh key without password, in terminal, but not through script? #22396

Discussion options

You must be logged in to vote
cesarmsj:

Host key verification failed.
fatal: Could not read from remote repository.

The error message is about the host key, not your identity key. The host key is what GitHub’s SSH server uses for authentication, to ensure you’re talking to the right server (and not, say, deploying code provided by some MITM attacker).

The correct host key must be listed in the user’s ~/.ssh/known_hosts file. You could either copy the relevant line from yours, or connect interactively as the nginx user and confirm after checking the fingerprint against this list: GitHub's SSH key fingerprints - GitHub Docs

cesarmsj:

With the root user, in the terminal, if I run git pull, it works ok

As a side …

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants