wakatime-cli: Cannot read remote files through ssh

As discussed in https://github.com/wakatime/wakatime-cli/issues/426, waketime can not read remote files through ssh. I tried to make a minimal reproduction sample in this issue.

Steps

  1. ssh 124.16.139.208 -p 10722 login without password currectly.
  2. wakatime-cli --entity ssh://124.16.139.208:10722/home/wangtianshu/test_project/test.py got error

Configs

~/.ssh/config: empty ~/.ssh/knwon_hosts:

[124.16.139.208]:10722 ssh-ed25519 AAAAC3***
[124.16.139.208]:10722 ssh-rsa AAAAB3***
[124.16.139.208]:10722 ecdsa-sha2-nistp256 AAAAE2***

Logs:

{"caller":"github.com/wakatime/wakatime-cli/pkg/remote/remote.go:88","func":"1","level":"error","message":"failed to download file to temporary folder: failed to connect to sftp host: failed to connecto to '124.16.139.208:10722': ssh: handshake failed: ssh: host key mismatch","now":"2022-02-23T10:35:58+08:00","version":"v1.37.0"}
{"caller":"github.com/wakatime/wakatime-cli/pkg/language/chroma.go:128","func":"selectByCustomizedPriority","level":"warning","message":"failed to load folder extensions: failed to read directory: open ssh://124.16.139.208:10722/home/wangtianshu/test_project/: no such file or directory","now":"2022-02-23T10:35:58+08:00","version":"v1.37.0"}

Environment:

  • OS: mac
  • Platform: 386

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 28 (14 by maintainers)

Most upvoted comments

@gandarez I tried to delete known_hosts and ssh, these three entries are both added.