Netcat的工作,但SSH不

我试图连接到我的SSH服务器。 当我做我得到通常的错误:

Could not resolve hostname xxxx:22: Name or service not known 

但是当我运行nc -v xxxx 22我得到:

 Connection to xxxx 22 port [tcp/ssh] succeeded! SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu1 

我不知道如何解决这个问题的下一步是什么。 有什么想法吗?

你不显示你使用什么命令通过SSH连接

看起来你是这样做的

 $ ssh 192.168.1.1:22 ssh: Could not resolve hostname 192.168.1.1:22: Name or service not known 

语法是

 ssh ip -p port 

 $ ssh 192.168.1.1 -p 22 The authenticity of host '192.168.1.1 (192.168.1.1)' can't be established. RSA key fingerprint is SHA256:fPvLlf+BPZHq47Y1GF67YofaAn1jYLElis0. Are you sure you want to continue connecting (yes/no)? 

但是,端口22是默认的SSH端口,您不需要指定它。