小编J. *_*Doe的帖子

添加 SSH 密钥后 GitLab 要求输入密码

亲爱的 StackOverflow 社区,

我按照此(https://gitlab.com/help/ssh/README)指令创建了 ssh-keys。我将 ED25519 SSH 密钥对添加到网页上的 GitLab 配置文件中,如果我这样做,ssh -T git@gitlab.com我确实会收到消息Welcome to GitLab, @username!,到目前为止它似乎有效。

但是,我想git pushgit pull本地存储库到 GitLab,而无需每次都输入密码。据我了解 SSH 密钥,这应该正是他们所做的,对吧?

编辑:

我的.ssh/config包含:

Host machine                                                                                                                                                                                                   
      User username                                                                                                                                                                                           
      HostName machine.webside.com
Run Code Online (Sandbox Code Playgroud)

其中.gitconfig包含:

[user]                                                                                                                                                                                                      
        name = John Doe                                                                                                                                                                                   
        email = john.doe@email.com
Run Code Online (Sandbox Code Playgroud)

并且.git/config包含:

[core]                                                                                                                                                                                                      
        repositoryformatversion = 0                                                                                                                                                                         
        filemode = true                                                                                                                                                                                     
        bare = false                                                                                                                                                                                        
        logallrefupdates = true                                                                                                                                                                             
[remote "origin"]                                                                                                                                                                                           
        url = https://gitlab.com/johndoe/projectname.git                                                                                                                                              
        fetch = +refs/heads/*:refs/remotes/origin/*                                                                                                                                                         
[branch "master"]                                                                                                                                                                                           
        remote = …
Run Code Online (Sandbox Code Playgroud)

ssh-keys gitlab ubuntu-18.04

0
推荐指数
1
解决办法
2137
查看次数

标签 统计

gitlab ×1

ssh-keys ×1

ubuntu-18.04 ×1