0

I'm trying to delete default pi user, i've tried many things but it seems that i can't have him removed.

This is what i do

delete processes of pi user

sudo pkill -u pi

delete user

sudo deluser pi

retuns

Removing user pi ...
Warning: group pi has no more members.
userdel: user pi is currently used by process 1730

even if i kill that process and rerun the commands there is another process that get's activated on another PID

ps -lp {process id}

F S   UID   PID  PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD
4 S  1000   657     1  0  80   0 -  3676 -      ?        00:00:00 systemd

I'm following this documentation to enhance security on my raspberry

Related stack overflow post that didn't work for me: Can't delete pi user on Raspbian

  • Welcome -- but it would be useful if you could say what process that is. Eg., edit in the output from ps -lp ___ replacing ___ with the pid. – goldilocks Oct 06 '20 at 14:49
  • it's systemd i'll update the question with it – Phill Alexakis Oct 06 '20 at 14:53
  • Have you tried rebooting? If that starts up again at boot, it is because pi is being autologged in, as per that other question, and you have to disable that. If it doesn't you should be free to delete pi. – goldilocks Oct 06 '20 at 15:02
  • I'm already signed in with my new user and ls /home shows only my new user. How is the pi logged in? . On reboot says User pi is logged in on tty1, of course i'm forcing it with systemctl reboot -i – Phill Alexakis Oct 06 '20 at 15:07
  • i tried sudo pkill -KILL -u pi and still doesn't kill the processes, there are replaced with new ones – Phill Alexakis Oct 06 '20 at 15:10
  • 1
    "How is the pi logged in?" -> Because autologin is enabled. That's the only way that can happen. So the problem is the same problem as from the post who's solution "didn't work for you". Unfortunately it is impossible to say what you did wrong, what might have changed in the past few years etc. since you don't actually explain what you did and what "didn't work". – goldilocks Oct 06 '20 at 16:28

0 Answers0