treeverse / treeverse/dvc

SSH tries to use default private key even if use_password is specified

Open
#10,909 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
15.9k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

Bug Report

Issue name

SSH tries to use default private key even if use_password is specified

Description

.dvc/config:

['core']
    remote = myserver

['remote "myserver"']
    url = ssh://myuser@mypublicip:/data
    ask_password = true

~/.ssh/config :

Nothing related to mypublicip.

When I run uv run dvc push:

$ uv run dvc push
Collecting                                                                                                                                                                                                                      |1.00 [00:00,  118entry/s]
PushingEnter a password for myuser@myserver:
# (I enter password here)
                                                                                                                                                                                                                                                         Enter passphrase for key '~/.ssh/id_ed25519': ent/files/md5'|                                                                                                                                                         |0/? [00:00<?,    ?files/s]
Enter passphrase for key '~/.ssh/id_ed25519': 
Enter passphrase for key '~/.ssh/id_ed25519': 
Pushing
Everything is up to date.  

You can see that I just press Enter when it tries to decrypt my private key, then gives up, but it works anyway because of course, the password I previously entered authenticates myuser and '~/.ssh/id_ed25519' has nothing to do with the host...

Reproduce

See above.

Expected

Asks for password to authenticate as myuser and doesn't ask me to unlock my default ssh key that doesn't even authenticate to mypublicip and is not listed in ~/.ssh/config

Environment information

I am using uv for my virtual env with the following pyproject.toml:

[project]
name = "project-name"
version = "0"
requires-python = ">=3.14"

dependencies = [
  "dvc[ssh]",
]

Output of dvc doctor:

DVC version: 3.63.0 (pip)
-------------------------
Platform: Python 3.14.0 on Linux-6.6.87.2-microsoft-standard-WSL2-x86_64-with-glibc2.39
Subprojects:
        dvc_data = 3.16.12
        dvc_objects = 5.1.2
        dvc_render = 1.0.2
        dvc_task = 0.40.2
        scmrepo = 3.5.3
Supports:
        http (aiohttp = 3.13.2, aiohttp-retry = 2.9.1),
        https (aiohttp = 3.13.2, aiohttp-retry = 2.9.1),
        ssh (sshfs = 2025.10.0)
Config:
        Global: ~/.config/dvc
        System: /etc/xdg/dvc
Cache types: hardlink, symlink
Cache directory: ext4 on /dev/sdd
Caches: local
Remotes: ssh
Workspace directory: ext4 on /dev/sdd
Repo: dvc, git
Repo.site_cache_dir: /var/tmp/dvc/repo/2546558791564caae91c6453b68d4f38

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the prompt sequence with uv run dvc push using the shown .dvc/config and empty ~/.ssh/config; inspect the SSH remote path and the reported sshfs support version. Trace where password authentication and the default private-key prompt are selected. Done means password authentication no longer prompts to unlock the unrelated default key, while the push still succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, python
Domain
cli, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.