如何通过 GIT Bash 访问 SSH 服务器

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22038811/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 17:47:42  来源:igfitidea点击:

How to Access SSH SERVER via GIT Bash

gitgit-bash

提问by gungunst

I have problem to access another server using GIT Bash.

我在使用 GIT Bash 访问另一台服务器时遇到问题。

do you now the command in GIT Bash ??

你现在有 GIT Bash 中的命令吗??

I have try but thats always show error : bad number

我试过了,但那总是显示错误:数字错误

回答by Mihai238

ssh user@server -p <port>works, at least for me.

ssh user@server -p <port>有效,至少对我而言。

回答by Brian

The command should be as follows if you are connecting to a remote server via SSH with a private key:

如果您使用私钥通过 SSH 连接到远程服务器,则命令应如下所示:

ssh <your-user-name>@<server-public-IP-address> -p <port-number> -i <your-local-ssh-private-key-name> 

I log into one of my servers with something like this, consider that my ssh key is under

我用这样的东西登录我的一台服务器,考虑到我的 ssh 密钥在

/c/Users/brianor ~/

/c/Users/brian或者 ~/

ssh [email protected] -p 2200 -i brianssh