Same website on a new machine

I worked on a website on my work machine, now I need to continue to work on this on my personal laptop from home.
I cloned the repository on my laptop, I exported the db and I took the upload folder.
I have a droplet on digital ocean, but unfortunately, it seems that I can add the ssh from the DO admin only when I create the droplet, so now I am not able to connect to that droplet with my laptop.
in fact i receive “Permission denied (publickey)” as error.

what is the best thing that I can do?

I was thinking to create a new droplet and this time add the 2 ssh keys (work shh and my home laptop ssh), update the host file, commit the change and provisioning the new droplet, but I am not sure if this is the best thing to do.

otherwise, I saw that in group_vars/all/users.yml it seems that I can add the github keys of multiple users.

  - name: username
      - primary_group
      - other_group
      - "{{ lookup('file', '/path/to/local/file') }}"

is it correct? Did I understand well? (not 100% sure about this, I am not confident with the ssh yet, but I am trying to understand and study at the same time)
is this can be a solution to my problem?

what are the best practices to work on the same project with colleagues with a different machine?
what are the steps that the “new” colleague needs to do?

many thanks

always me, I am thinking that I will go with the first solution because I went on holiday (but I still need to work on that website) and I don’t have access to my work’s machine anymore.

it seems straight forward to me, is this a correct way?

I have just one doubt.
I already activated the SSL on my “old droplet” (staging environment), do I need to be aware of something or I can just create the new droplet, update the host file, commit the change and provisioning the new droplet, update and point the DNS to the new droplet, and the re-provisioning again just for the SSL with ansible-playbook server.yml -e env=staging --tags letsencrypt

that’s all?

any answer/help/feedback it would be great because I am still learning trellis, and I am not super confident.

The idea of PKI (Public-Key-Infrastructure), also SSH-keys is that each user can put the public key for their own private key onto the host they want to SSH into. The public key is then used by the SSH server to check whether the user that connects to it has the corresponding private key. The public key can be shown to anyone. So your colleague just sends you his public key and you add it to the list of allowed public keys on the server and then your coulleague can SSH into it using his private key that never leaves his own machine. Public-Key-Infrastructure, not Private-Key-Infrastructure, lol…

Yep that’s fine :+1:

This topic was automatically closed after 42 days. New replies are no longer allowed.