mutagen-io / mutagen

Fast file synchronization and network forwarding for remote development
https://mutagen.io
Other
3.47k stars 153 forks source link

Permission denied (publickey) error when authenticating with remote public key. #472

Closed clement-chaneching closed 10 months ago

clement-chaneching commented 10 months ago

Hello,

I am trying to use coiled which is based on mutagen to spin a notebook and have a live synchronization between the cloud resource and local dir.

So it spins a cloud VM, generate a new ssh key pair, and add the keys in my local known_hosts.

image

I can successfully ssh and scp usingssh ubuntu@cluster-ycjwl.dask.host

But I cannot run mutagen: mutagen sync create --name coiled-350224 . ubuntu@cluster-ycjwl.dask.host:/scratch/synced

Connecting to agent (POSIX)...                                                  
Error: unable to connect to beta: unable to connect to endpoint: unable to dial agent endpoint: unable to handshake with agent process: unable to receive server magic number: EOF (error output: ubuntu@cluster-ycjwl.dask.host: Permission denied (publickey).)

If I ssh in my cloud VM and manually add my local public key in the remote authorized key, it will work but that is not what I want. I think I might be missing a mutagen config somewhere to use the known_hosts config?

I am using WSL Debian with mutagen and openssh installed: OpenSSH_8.4p1 Debian-5+deb11u3, OpenSSL 1.1.1w 11 Sep 2023 Mutagen version 0.17.4

Thanks for your help!

xenoscopic commented 10 months ago

@clement-chaneching Do you know which authentication mechanism is being used for your standard ssh operations that are working (e.g. ssh ubuntu@cluster-ycjwl.dask.host)? I don't think the known_hosts configuration would have any impact here, but ~/.ssh/config might. My guess would be that coiled is adding its generated key configuration to ~/.ssh/config, but I don't know why it's not being picked up when Mutagen invokes ssh. You could try running ssh with one or more -v flags and seeing which key it's using, but otherwise I would check ~/.ssh/config for any coiled-generated configuration. I'm happy to take a look if you're able to share excerpts.

clement-chaneching commented 10 months ago

Thanks for the reply @xenoscopic Actually I just restarted everything, deleted all the ssh agent and known hosts, and I can't seem to reproduce the error. I do not have any config file for ssh, so I have no idea what was causing this issue but seems ok now!