I setup a ssh key for github account, so I don\'t have to enter the password every time, it works fine. Here is the script I use:
#!/bin/bash
git push origin
As mentioned in one of your thread, you need to point the root user which executes your cron script to the right HOME
(the one which contains $HOME/.ssh/id_rsa(.pub)
, your public and private keys.
#!/bin/bash
HOME=/home/yourAccount git push origin master
If that doesn't work, start debugging your ssh command with
#!/bin/bash
HOME=/home/yourAccount ssh -Tvvv yourGitServer
And check that with first a simple private key (not protected by a passphrase).
Then, if you need a passphrase, make sure your ssh-agent is running in order to cache said passphrase (or using keychain, as I mentioned before).
According to your logs, the public ssh key is proposed, but rejected.
debug1: Trying private key: /home/jack/.ssh/id_rsa
debug3: no such identity: /home/jack/.ssh/id_rsa
Double-check "BitBucket Set up SSH for Git", and make sure your id_rsa
and id_rsa.pub
are there, with the right protection.
Check also your id_rsa.pub
has been added to your BitBucket account (as one line).