ssh 连接 issue

计算机系统导论 133 views 3 replies
#1 · (edited)
zilong@zilong MINGW64 ~/.ssh (master)
$ ssh-copy-id 22214111xx-ics@igw.dfshan.net
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/c/Users/18318/.ssh/id_ed25519.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

/usr/bin/ssh-copy-id: ERROR: kex_exchange_identification: Connection closed by remote host
ERROR: Connection closed by 198.18.0.35 port 22

这个报错是什么意思?iPad 连接成功过了,怎么电脑连不了?

#2 · (edited)

这个 ssh-copy-id 设置免密登录的 时候需要指定端口号为 2291 的,试一下
ssh-copy-id -i ~/.ssh/id_rsa.pub "-p 2291 user@server"
如果 config 文件已经写好类似下面这样

Host hostname
  HostName igw.dfshan.net
  User xxxxx-ics
  Port 2291

可以直接ssh-copy-id hostname

#3 ·
zilong@zilong MINGW64 ~/.ssh (master)
$ ssh-copy-id -p 2291 22214111xx-ics@igw.dfshan.net
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/c/Users/18318/.ssh/id_ed25519.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

/usr/bin/ssh-copy-id: ERROR: kex_exchange_identification: Connection closed by remote host
ERROR: Connection closed by 198.18.0.35 port 2291
#4 ·
zilong@zilong MINGW64 ~/.ssh (master)
$ ssh 22214111xx-ics@igw.dfshan.net -p2291
kex_exchange_identification: Connection closed by remote host
Connection closed by 198.18.0.35 port 2291