错误用户的git ssh权限被拒绝
使用这样一个简单的git命令错误用户的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 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