atsign-foundation / noports

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

bug (universal.sh): root owned .ssh and .local directories #1142

Closed XavierChanth closed 1 week ago

XavierChanth commented 2 weeks ago

I'm really not sure how this happened, running fedora 40 with the systemd install.

Setup sshnpd first, then realized I didn't have openssh-server installed so I went back and added it to the machine.

image

Both .local/ and .ssh/ were owned by root. We also had a similar issue with .sshnp earlier today.

I'm thinking we should add a step to universal.sh which executes mkdir -p <dir> on all directories we use (.atsign, .local/bin, .sshnp, .ssh) at the beginning, and then chown -R user:user <dir> | chown -R user <dir> towards the end of installation.

cpswan commented 2 weeks ago

I just did a device install using 5.3.0 universal.sh onto a freshly installed (default) Fedora 40 Server:

image

.ssh is certainly a problem. In my case .local is as expected.

cpswan commented 2 weeks ago

Looks like the problematic piece is in install.sh rather than universal.sh:

# SETUP AUTHORIZED KEYS #

setup_authorized_keys() {
  mkdir -p "$user_ssh_dir"
  touch "$user_ssh_dir/authorized_keys"
  chown $user:$user "$user_ssh_dir/authorized_keys"
  chmod 644 "$user_ssh_dir/authorized_keys"
}
Xlin123 commented 1 week ago

was this closed in #1153 ? @XavierChanth

XavierChanth commented 1 week ago

was this closed in #1153 ? @XavierChanth

Should be