Is there a way to specify which ssh key should be used for npm install

Here are a few solutions:

  • Add an entry to your ~/.ssh/config. For example:

    Host bitbucket.org
         IdentityFile ~/.ssh/bitbucket_key
         IdentitiesOnly yes
    
  • Use ssh-agent and add your key to the agent instance beforehand.

  • Use something like ssh-ident for choosing ssh agents and identities dynamically based on the current working directory or arguments passed to ssh-ident. As their readme states, you would typically alias ssh-ident to ssh so that it’s automatically used everywhere.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)