Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
错误用户的git ssh权限被拒绝_Git_Ssh - Fatal编程技术网

错误用户的git ssh权限被拒绝

错误用户的git ssh权限被拒绝,git,ssh,Git,Ssh,使用这样一个简单的git命令 $ git push --set-upstream origin master 我得到: 我尝试切换用户: git config credential.username 'oresoftware' 但也犯了同样的错误。我在~/.ssh/config中有这个 ControlMaster auto ControlPath /tmp/ssh_mux_%h_%p_%r ControlPersist 2h Host * ForwardAgent yes

使用这样一个简单的git命令

$ git push --set-upstream origin master
我得到:

我尝试切换用户:

git config credential.username 'oresoftware'
但也犯了同样的错误。我在~/.ssh/config中有这个

ControlMaster auto
ControlPath /tmp/ssh_mux_%h_%p_%r
ControlPersist 2h

Host *
    ForwardAgent yes
    AddKeysToAgent yes
    UseKeychain yes

GSSAPIAuthentication no
ServerAliveInterval 240
ServerAliveCountMax 3


Host the1mills.github.com
     HostName github.com
     User the1mills
     IdentityFile ~/.ssh/the1mills


Host oresoftware.github.com
     HostName github.com
     User oresoftware
     IdentityFile ~/.ssh/oresoftware


Host bitbucket.org
     HostName bitbucket.org
     User oresoftware
     IdentityFile ~/.ssh/oresoftware

Host alex-teros.github.com
     HostName github.com
     User alex-teros
     IdentityFile ~/.ssh/github
我能做些什么来解决这个问题吗?
明显的问题是它说我是“alex teros”,但我想成为这个命令的“oresoftware”。

如果你想使用ssh配置,你的URL应该使用它的一个条目(参考github.com)

例如:

oresoftware.github.com:oresoftware/tsc-multi-watch.git
然后,也只有在那时,才会使用正确的私有SSH密钥(
~/.SSH/oresoftware


您只需将
用户或软件
替换为
用户git
:当推到GitHub n SSH时,用户始终是
git

源代码的url是什么?(运行git remote get url源代码)源代码为:
git@github.com:oresoftware/tsc multi-watch.git
我认为
~/.ssh/config
中的
主机不应该包含用户名。git远程url?现在是
git@github.com:oresoftware/tsc multi-watch.git
,我应该将其更改为什么?即使我有
源代码git@the1mills.github.com:Themills/siamese.git(fetch)
,它仍然显示:
错误:alex teros拒绝对Themills/siamese.git的权限。
alex teros是错误的用户,我想成为这个操作的
1mills
。@MrChologit@github:部分需要替换为配置主机条目,该条目将使用正确的私钥
git远程设置url origin oresoftware.github.com:oresoftware/tsc multi-watch.git
oresoftware.github.com:oresoftware/tsc-multi-watch.git