cockpit-project / cockpit

Cockpit is a web-based graphical interface for servers.
http://www.cockpit-project.org/
GNU Lesser General Public License v2.1
11.31k stars 1.12k forks source link

Deleting the cockpit-ws user #11049

Closed iohenkies closed 5 years ago

iohenkies commented 5 years ago

Hi,

Yesterday I've installed and tried cockpit on my Debian 9.6 box and decided this isn't the tool for me. I've deinstalled the software and all was fine.

Today I was notified by my HIDS that there was still a 'cockpit-ws' user present. I wanted to remove this with the 'userdel' command, as always removing the home with it with 'userdel -rf' and ended up with a non responsive system. I had to revert to a complete system snapshot.

Long story short: since 'cockpit-ws' has '/' as home (see '/etc/passwd'), 'userdel -rf' will try to delete '/'. I don't know if I'm not following best practices or something while deleting the software and/or the user, or that somehow you, the cockpit developers, could somehow warn people about this.

So at the very least: FYI.

martinpitt commented 5 years ago

Ouch! Sorry to hear that, this is indeed a lingering trap. I hope you didn't lose anything?

The home directory should not be /, but some bogus value.

In fact the Debian Policy says that it should be /nonexisting.

iohenkies commented 5 years ago

Hi Martin,

Fortunately there was a very recent backup. Maybe I shouldn't have used the 'force' option, but that never got me in trouble before. Lesson learned.

That said, I did install the software via this procedure: https://cockpit-project.org/running.html#debian

and did not change anything. But the home still was /.