如何通过 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
How to Access SSH SERVER via GIT 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/brian
or ~/
/c/Users/brian
或者 ~/
ssh [email protected] -p 2200 -i brianssh