在windows平台下使用mygit软件连接github时,按照github官网上的Set Up Git一步一步来的时候,到$ ssh -T git@github.com时,显示:ssh: connect to host github.com port 22: Bad file number。这是为什么?

使用-v参数查看时,显示: debug1: Applying options for http://github.com debug1: Connec…
关注者
8
被浏览
10,535
登录后你可以
不限量看优质回答私信答主深度交流精彩内容一键收藏

貌似是因为22端口默认是不开启的。创建一个默认路径的publickey (/c/user/UserName/.ssh/id_rsa)

再新建一个config 文件(无拓展名) 内容可参照:

Host github.com

User [username]

HostName ssh.github.com

PreferredAuthentications publickey

IdentityFile ~/.ssh/id_rsa

Port 443