【无标题】ssh修改默认端口号后无法连接(提示ssh: Could not resolve hostname)

ssh命令语法:
usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface]
[-b bind_address] [-c cipher_spec] [-D [bind_address:]port]
[-E log_file] [-e escape_char] [-F configfile] [-I pkcs11]
[-i identity_file] [-J [user@]host[:port]] [-L address]
[-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
[-Q query_option] [-R address] [-S ctl_path] [-W host:port]
[-w local_tun[:remote_tun]] destination [command]
本地修改端口后无法连接ssh
C:\Users\jition>ssh jition@127.0.0.1:2222
ssh: Could not resolve hostname 127.0.0.1:2222: \262\273\326\252\265\300\325\342\321\371\265\304\326\367\273\372\241\243

解决方法:

使用指定端口号登录(-l 表示login_name -p 表示端口号)

[cqs@centos7 ~]$ ssh -l jition 192.168.1.105 -p 2222

[cqs@centos7 ~]$ ssh jition@192.168.1.105 -p 2222


[cqs@centos7 ~]$ ssh -l jition 192.168.1.105 -p 2222The authenticity of host ‘[192.168.1.110]:2222 ([192.168.1.110]:2222)’ can’t be established.
ECDSA key fingerprint is SHA256:Tui3jBxEkVlIvIlMGbv2SoijP9xP4bPflwoUPV+gX4o.
Are you sure you want to continue connecting (yes/no)? no

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值