我使用bitbucket托管一些git存储库。
当我尝试做时:
git pull && git push
我得到:
mux_client_request_session: session request failed: Session open refused by peer
ControlSocket /home/ravi/.ssh/sockets/socket-git@bitbucket.org:22 already exists, disabling multiplexing
答案 0 :(得分:3)
bitbucket.org has intentionally disabled ssh multiplexing,因此请编辑您的~.ssh/config
文件,以便ssh在连接时不会尝试多路传输。
如果您在配置的顶层拥有ControlMaster
,请确保将其删除,因为它会取代任何Host
部分的配置。
然后添加:
Host bitbucket.??? # .org and .com
ControlMaster no
Host *
ControlMaster auto
ControlPersist yes
ControlPath ~/.ssh/socket-%r@%h:%p
请注意,Host bitbucket.org
必须位于Host *
之前。
此外,ControlPath
应该只能自己写。
然后,如果错误消息中命名的ControlSocket
仍然存在,请将其删除。 (它将根据ControlPersist
中的超时自动删除。
答案 1 :(得分:1)
另一种方法是在本地存储库配置中更改git ssh命令并禁用多路复用模式。
git config --local core.sshCommand "ssh -o ControlPath=none"