atsign-foundation / noports

Connect to any device with no external listening ports open
https://noports.com
BSD 3-Clause "New" or "Revised" License
265 stars 15 forks source link

universal.sh creates .atsign/keys directory with (wrong) root:root ownership when run with `sudo` #984

Closed cpswan closed 4 months ago

cpswan commented 4 months ago

Describe the bug

Script creates keys directory with wrong ownership when run with sudo

Steps to reproduce

  1. First I created a fresh VM on GCP
  2. Then I logged into it with gcloud ssh
  3. And then I downloaded universal.sh from the v5.1.0 release
  4. I ran sudo sh universal.sh and did a device install
  5. When I tried to copy a key in ~/.atsign/keys I found that I couldn't as it was owned by root:root, so I had to do sudo chown -R ubuntu:ubuntu ~/.atsign

Expected behavior

Ownership to user

Additional context

This got missed in testing as I was using VM snapshops with atKeys already in place

cconstab commented 4 months ago

I saw similar issues with ~/.authorized_hosts in https://github.com/atsign-foundation/noports/issues/974