PM2 (Node.js) deploy - Host key verification failed

1.9k views Asked by At

When i trying make deploy, i have error

Host key verification failed. fatal: The remote end hung up unexpectedly error: Could not fetch origin

fetch failed

Deploy failed

My repo located on Bitbucket. All ssh-keygen is added to Bitbucket

Any ideas?

Thank

1

There are 1 answers

0
Rony Setyawan On
production: {
        user: 'ubuntu',
        key: '~/.ssh/node_ec2.pem',
        host: 'ec2-52-221-188-28.ap-southeast-1.compute.amazonaws.com',
        ref: 'origin/master',
        repo: '[email protected]:telkomdev/belajarcoding-apis.git',
        path: '/home/ubuntu',
        'post-deploy': 'npm install && pm2 startOrRestart 
ecosystem.config.js'
}

You must give ssh on your user when connecting, for example above is ubuntu user, not root user on ecosystem.config.js.