2

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?

neringab
  • 613
  • 1
  • 7
  • 16

1 Answers1

1

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.

Shcheklein
  • 5,979
  • 7
  • 44
  • 53
  • Hello, thank you for your help, I created local config entry. However, when I deleted my SSH key files (because I do not want others to use my SSH), when I do `dvc push -r example` I receive error saying permission denied. Is there a way to tell DVC to ask for a password? – neringab Feb 01 '22 at 15:20
  • I would try `dvc remote modify storage_server ask_password true` ... I would though try to use SSH still. You can secure SSH files to be accessible only to you - https://unix.stackexchange.com/questions/257590/ssh-key-permissions-chmod-settings/595537 . SSH is still the best and the most secure way to go. – Shcheklein Feb 01 '22 at 15:45