SSH keys generated for a specific user in my workspace only work for about 24 hours. I've tried creating the SSH keys in the workspace as well as within the personal settings for that user's Bitbucket account.
The SSH keys loaded onto my personal account are working perfectly and have done so for months.
Once created they work for about 24 hours and thereafter she gets the "permission denied (public key)" error when attempting to perform any sort of operation (push, pull, fetch...)
Hi, @Marcus EchoBlue, thank you for reaching out to Atlassian Community.
This seems to be related to the key that is added to the ssh-agent. Either the agent is losing the key after 24h, or a different SSH key is being offered (if you have multiple keys in the .ssh directory).
The first thing I would suggest when you face this issue is to try to add this key to your agent again. You can run the following command to achieve this:
ssh-add ~/.ssh/<private_key_file>
You can run the following command to confirm which key is being offered when interacting with your repo, to confirm if it’s the correct one or not:
GIT_SSH_COMMAND="ssh -vvv" <git command>
And you can also try specifying the private SSH key in the config file. You can add the following to the file named config in your ~/.ssh directory (if the file named config doesn't exist, you can create it):
Host bitbucket.org
HostName bitbucket.org
User <YourBitbucketUsername>
PreferredAuthentications publickey
IdentityFile </Users/YourUser/.ssh/my_ssh_key>
Replace YourBitbucketUsername with your Bitbucket username and /Users/YourUser/.ssh/my_ssh_key with the path to the private key that is added to your Bitbucket user.
Please let me know how it goes and feel free to share any additional information regarding this case.
Kind regards,
Caroline
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.