Git 为每次推送输入长密码 [英] Git enter long passphrase for every push
问题描述
每次我尝试将任何内容推送到 GitHub 时,它都会询问我的地址 git@github.com:...
,然后它需要密码.有没有办法自动执行此操作?
Every time I try to push anything to GitHub it asks me the address git@github.com:...
and after that it wants the passphrase. Is there a way to automate this?
我使用的是 Linux Ubuntu.
I am using Linux Ubuntu.
推荐答案
你可以使用 ssh-agent
来记住你的密码(Gnome 会自动为你运行这个,通常......).>
You can use ssh-agent
to remember your passphrase (Gnome automatically runs this for you, normally...).
$ ssh-agent bash
$ ssh-add
Enter passphrase for /home/elyobo/.ssh/id_rsa:
Identity added: /home/elyobo/.ssh/id_rsa (/home/elyobo/.ssh/id_rsa)
从现在开始,在您运行此程序的终端内,您的密码将被记住.
From now on, from within the terminal that you run this, your pass phrase will be remembered.
理想情况下,您会使其自动运行,因此在 gnome 中运行的所有 shell 都可以运行;查看 Gnome 钥匙圈.
Ideally you'd get it working automatically, so all shells running within gnome would work; check out Gnome Keyring.
这篇关于Git 为每次推送输入长密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!