Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple users in DVC

Tags:

dvc

I would like to ask if it is possible to use DVC with several accounts on the same machine. At the moment, all commands (dvc pull, dvc push, ...) are executed under my name. But after several people joined this project too, I do not want them to execute commands under my name.

When I was alone on this project I generated ssh key:

ssh-keygen

Connected to server where DVC remote data is stored:

ssh-copy-id username@server_IP

Created config file which lets me execute all dvc commands using ssh:

[core]
    remote = storage_server
['remote "storage_server"']
    url = ssh://username@server_IP:/home/DVC_remote/DVC_project

What I should do so that several people could execute commands on their own name?

like image 854
neringab Avatar asked Feb 17 '26 07:02

neringab


1 Answers

You need to make the "username" part of the config personalized based on who is running the command. There are a few options to do this (based on this document, see the SSH part):

Basic options are:

  • User defined in the SSH config file (e.g. ~/.ssh/config) for this host (URL);
  • Current system user;

So, the simplest even options could be just remove it from the URL and rely on the current system user?

Local (git-ignored or per-project DVC config) config

You could do is to remove the username part from the url and run something like this:

dvc remote modify --local storage_server user username

--local here means that DVC will create a separate additional config that will be ignored by Git. This way if every user runs this command in every project they use they will customize the username.


Let me know if that helps or something doesn't work. I'll try to help.

like image 87
Shcheklein Avatar answered Feb 21 '26 15:02

Shcheklein



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!