Store SSH key passphrase persistently

2019-07-25 09:30发布

My development environment is configured in a Virtual Machine on my Mac (Vagrant box using Debian 8).

I've installed Git on the VM with SSH remote access. Everything works perfectly fine except that I always have to enter my passphrase for the first git push origin master after having booted my VM.

Here's my list of remotes :

origin  git@github.com:PiR-P/my_repo.git (fetch)
origin  git@github.com:PiR-P/my_repo.git (push)

I've tried this solution (https://stackoverflow.com/a/10032655/6391764) but it only works until I shut down my VM.

Is there anyway to make it persistent even after having stop / reboot my VM?

标签: git github ssh
1条回答
欢心
2楼-- · 2019-07-25 09:49

You can remove passphrase from the private key running ssh-keygen -p (enter old passphrase and press [Enter] two times to enter an empty new passphrase). But you have to understand the passphrase protects the private key, so by removing it you make your key more vulnerable to stealing.

查看更多
登录 后发表回答