I was using git on a remote server (Ubuntu 14.04 LTS). It works smoothly, until a certain amount of time passed by. I was denied access to the repository (no this issue on my local machine). How does this happen? And is there anyway to solve it?
Make sure the authorized_keys file and the private key itself have the correct permissions and ownership. Check that key-based authentication is allowed by the server. Make sure the private key is readable by the SSH client. If you're using PuTTY, make sure your SSH keys are properly configured for the session.
Traditional SSH keys have no expiry; in fact they have no metadata whatsoever (except maybe a comment field).
As a security precaution, GitHub automatically deletes SSH keys that haven't been used in a year.
SSH keys do not have expiration dates. Rotation of keys is up to your internal process. PGP keys and SSL certificates have expiration dates built-in as part of their public specifications.
First, an ssh key does not "expire" (ssl certificates do, but that is another topic). They are revoked (removed from the .authorized_keys on the remote side)
(Update August 2019: as shown in "SSH certificate authentication for GitHub Enterprise Cloud", SSH allows one SSH key (a certificate authority) to sign another SSH key, along with information about the developer it belongs to. And that include an expiration date)
Second, if it was working and no longer work, something must have changed, like the $HOME
value (since ssh looks for a public/private key in $HOME/.ssh
)
If is possible that the process using ssh does not run with the usual account, but with another user (or with root if preceded by sudo
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With