gpt4 book ai didi

git - ssh:连接到主机 bitbucket.org 端口 22:连接超时

转载 作者:IT王子 更新时间:2023-10-29 00:58:50 25 4
gpt4 key购买 nike

一切正常。一些 git pushes 没有问题。

今天我决定将我的框架更新到最新版本,所以它稍微改变了我项目的目录结构。因此,在 Bitbucket 中,我创建了一个新存储库 (dev1.project.com) 并将我项目的文件夹从 OldName 重命名为 dev1.project.com .

我编辑了 .git/config 以指向我的新存储库:

[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[branch "master"]
[remote "origin"]
url = https://bitbucket.org/user/dev1.project.com.git
fetch = +refs/heads/*:refs/remotes/origin/*

当我执行 git remote -v 时,我得到:

origin  ssh://git@bitbucket.org/user/dev1.project.com.git (fetch)
origin ssh://git@bitbucket.org/user/dev1.project.com.git (push)

我回到我的项目文件夹,然后输入:

git init
git add .
git commit -m 'my first commit'
git push -u origin master

但我不断收到以下错误:

ssh: connect to host bitbucket.org port 22: Connection timed out
fatal: The remote end hung up unexpectedly

命令 ssh -T git@bitbucket.org 得到与上面相同的消息。

命令:git config --get remote.origin.url 显示:

git@bitbucket.org:user/dev1.project.com.git

status.bitbucket.org表明他们这边一切正常。

不确定为什么它以前可以工作,而现在不工作。

我在 CentOS 上,我不确定下一步该做什么。我看过一些与 iptables 相关的答案,所以我尝试了这个:

iptables -t filter -A OUTPUT -p tcp --match multiport --dport 22 -j ACCEPT

service iptables stop
service ip6tables stop
service sshd reload
service iptables start
service ip6tables start

但仍然没有,有什么想法吗?

Ps:我也已经将 CentOS 从 6.6 更新到 6.7,将 PHP 5.4 更新到 5.6,但认为这无关紧要。

更新 #1

运行以下命令:

ps x | grep ssh-agent
eval `ssh-agent -s`
ssh-add # then it asked for my password

收到消息:

Identity added: /root/.ssh/id_rsa (/root/.ssh/id_rsa)

然后

service sshd restart

但还是没有

更新#2

我给我的 VPS 托管公司发了邮件,询问我是否可以做些什么来打开端口 22,他们回答说:

I have disabled the monitoring system on the host node blocking traffic to Bitbucket.

我不知道这是什么意思,但在那之后一切正常,显然我对此无能为力。

最佳答案

我已经完成了下面提到的事情并且它开始工作了。

 vim ~/.ssh/config

添加这些行并保存。

Host bitbucket.org
Hostname altssh.bitbucket.org
Port 443

关于git - ssh:连接到主机 bitbucket.org 端口 22:连接超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33377296/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com