gpt4 book ai didi

macos - OSX Terminal.app SSH 端口

转载 作者:行者123 更新时间:2023-11-29 09:35:40 24 4
gpt4 key购买 nike

我觉得自己像个彻头彻尾的傻瓜 - 但我似乎无法通过 Terminal.app 和 SSH 连接到非标准 SSH 端口。我在山狮。

我已经尝试了以下所有方法:

$ ssh myuser@mysite.com -p 42586
$ ssh myuser@mysite.com -p42586
$ ssh -p 42586 myuser@mysite.com
$ ssh -p42586 myuser@mysite.com

我似乎无法获得正确的语法,以上所有都会产生错误。旗帜的正确顺序是什么?我检查了 man 页面,它显示在 [user]@[domain] 部分之前,但是,这也会引发错误。

编辑:

更多信息和原始终端输出:

$ ssh mysite.com -p42586
--hangs--
$ ssh mysite.com -p 42586
--hangs--
$ ssh -p42586 mysite.com
usage: grep [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ] [-A num] [-B num] [-C[num]]
[-e pattern] [-f file] [--binary-files=value] [--color=when]
[--context[=num]] [--directories=action] [--label] [--line-buffered]
[--null] [pattern] [file ...]
usage: ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
[-D [bind_address:]port] [-e escape_char] [-F configfile]
[-I pkcs11] [-i identity_file]
[-L [bind_address:]port:host:hostport]
[-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
[-R [bind_address:]port:host:hostport] [-S ctl_path]
[-W host:port] [-w local_tun[:remote_tun]]
[user@]hostname [command]
$ ssh -p 42586 mysite.com
usage: grep [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ] [-A num] [-B num] [-C[num]]
[-e pattern] [-f file] [--binary-files=value] [--color=when]
[--context[=num]] [--directories=action] [--label] [--line-buffered]
[--null] [pattern] [file ...]
/usr/bin/ssh: option requires an argument -- p
usage: ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
[-D [bind_address:]port] [-e escape_char] [-F configfile]
[-I pkcs11] [-i identity_file]
[-L [bind_address:]port:host:hostport]
[-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
[-R [bind_address:]port:host:hostport] [-S ctl_path]
[-W host:port] [-w local_tun[:remote_tun]]
[user@]hostname [command]

示例 1 和 2 挂起直到超时。 3 和 4 产生 grep 用法回显以及 ssh 用法回显。

编辑 2:

感谢@topguncoder 的建议,我最初的尝试是冒号符号 - 但会产生不同的错误:

$ ssh myuser@mysite.com:42586
ssh: Could not resolve hostname mysite:42586: nodename nor servname provided, or not known

最佳答案

尝试

"ssh" -p 42586 mysite.com

忽略您的别名 设置。看起来您可能将 ssh 别名为其他名称。如果这有效,您应该检查您的 .profile 是否有任何 ssh 别名。

关于macos - OSX Terminal.app SSH 端口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14716816/

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