cockpit icon indicating copy to clipboard operation
cockpit copied to clipboard

Adding "localhost" Host Denies Access to Main Account

Open Shadow8472 opened this issue 2 years ago • 4 comments

Explain what happens

  1. Login as johndoe
  2. Add new host
  3. Host: localhost User: janedoe
  4. User janedoe is automatically logged in whenever johndoe logs in.

In my case: "John Doe" is my main admin account. "Jane Doe" is a limited account for running a container in Podman without root access. In my specific case, I also have a second host running Debian 11/Cockpit 239 that can access the "John Doe" account properly.

Version of Cockpit

276.1

Where is the problem in Cockpit?

Navigation & Shell

Server operating system

other

Server operating system version

Rocky Linux 8

What browsers are you using?

Firefox

System log

No response

Shadow8472 avatar Jan 20 '23 02:01 Shadow8472

I managed to fix my immediate problem by editing /etc/cockpit/machines.d/99-webui.json to remove the problematic login over terminal.

I'm going to leave this issue as open though because this was a frustrating behavior to deal with. It behaved as expected when I used its IP (192.168.0.---).

Shadow8472 avatar Jan 20 '23 03:01 Shadow8472

Another update: connecting to 127.0.0.1 works similarly well to using its own IP from the local network.

Shadow8472 avatar Jan 22 '23 21:01 Shadow8472

I'm afraid I can't follow -- what exactly did you put into the "Add host" dialog, and what was the contents of /etc/cockpit/machines.d/99-webui.json? Can you still reproduce this?

martinpitt avatar Jul 04 '23 08:07 martinpitt

In short: I'm after multi-login functionality for managing separate containerized projects. Loopback addresses work nicely for this purpose, but using the string "localhost" in place of an IP when connecting to another user would log my account directly into that user.

I'm not up to reproducing it right now (or more specifically fixing it afterwords), but here is a recreation of how I goofed it in the first place. image

Shadow8472 avatar Aug 19 '23 01:08 Shadow8472