zoukankan      html  css  js  c++  java
  • github默认端口22被占用,ssh: connect to host github.com port 22: Connection timed out

    出现github 连接错误:

    ssh:connect to host github.com port 22:Connection timed out

    刚开始以为是网络问题,github不能连接上,但是使用ssh命令,用端口443测试发现可以连接上github

    ssh -T -p 443 git@ssh.github.com

    Enter passphrase for key '/root/.ssh/id_rsa':

    Hi yinfei1! You've successfully authenticated, but GitHub does not provide shell access.

    于是就怀疑端口22不能使用,端口22为ssh默认端口,初步怀疑和github服务器有关,于是将其端口修改为443:

    修改方法

    切换到 cd ~/.ssh/

    进入到~目录下面的.ssh下面,修改ssh配置,新建config文件

    将上述文件添加配置:

    Host github.com /*服务器地址为github地址*/

    User "XXX@XX.com" /*github上的注册邮箱为用户账号*/

    Hostname ssh.github.com /*服务器地址为github地址*/

    PreferredAuthentications publickey /*采用公匙*/

    IdentityFile ~/.ssh/id_rsa /*公匙文件路径*/

    Port 443 /*修改端口为443*/

  • 相关阅读:
    443. String Compression
    506. Relative Ranks
    825. Friends Of Appropriate Ages
    447. Number of Boomerangs
    54. Spiral Matrix
    744. Find Smallest Letter Greater Than Target
    HDU-1565 方格取数(1)
    zoj 3672 Gao The Sequence
    ZOJ 3675 Trim the Nails
    poj -2955 Brackets
  • 原文地址:https://www.cnblogs.com/yinfei/p/11385722.html
Copyright © 2011-2022 走看看