Getting "Unsupported URL" when adding SSH remote


I am trying to add a new ssh remote.

dvc remote add base ssh://

and I get a Initialization error: Config file error: Unsupported URL when trying dvc status/pull/push.

I tried adding
dvc remote modify base credentialpath ~/.ssh/config
but the error persists.

Can anyone help with an example on how to fully configure an ssh remote for dvc?

Later edit:
Solved: Typo in the remote url (the remote path was missing ‘/’ )


1 Like

Hi @elena !

Glad it resolved itself. Feel free to ask any questions, we are always happy to help!



Thanks for your prompt reply :slight_smile:.
I have another question related to ssh remotes for dvc.
Currently in my config file, the remote url has a ‘hardocded’ to my user name
['remote "base"'] url = ssh://elena@server.lan:/mnt/data

Ideally, I’d want my team to just do:
git pull && dvc pull and have everything set.
With my current setup however, they’ll have to manually edit the config file or edit the remote like so:
dvc remote modify base url ssh://john@server.lan:/mnt/data

Is there any way to make that dynamic or use an environment variable($USER) in the config instead?

Hi @elena !

We are actually currently defaulting to getuser()(i.e. $USER) if user is not specified in the url or with the dvc remote modify base user john, so it should actually work as is. Have you tried it?(i.e. just removing user from your url)


Yes, I see.
The problem is that the username on the remote servers differ slightly from the $USER on my local machine.


Ah, I see. In such case, you and your colleagues could use .dvc/config.local, which is a “local” version of .dvc/config, that is set to be ignored by git, so it stays on your machine in your repository. You and your colleagues will have to set it up just once when they first clone the git repository. The syntax would be:

dvc remote add --local base ssh://john@server.lan:/mnt/data

Would that suit your needs?



Thank you!