I have made a new Raspbian installation. All good. I wanted to delete pi user and make another user with same privileges (lets say gordon).
So first I enabled direct ssh access to user root by doing this:
sudo nano /etc/ssh/sshd_config
...and editing the line
#PermitRootLogin prohibit-password
to
PermitRootLogin yes
Then I restarted and directly login as root.
So I followed https://gordonlesti.com/change-default-users-on-raspberry-pi/ recommendations.
I added a step to make new user gordon belong to the same exact groups pi belongs. So I did this to know those groups...
root@raspberrypi:~# groups pi
pi : pi adm dialout cdrom sudo audio video plugdev games users input netdev spi i2c gpio
... and then this to make new user belong to them.
root@raspberrypi:~# usermod -a -G adm,dialout,cdrom,sudo,audio,video,plugdev,games,users,input,netdev,spi,i2c,gpio gordon
I also did a change in /etc/lightdm/lightdm.conf at line
autologin-user=pi
that I changed to
autologin-user=gordon
All good til I get to "Delete pi" step in the guide.
I get this error:
deluser pi
Removing user `pi' ...
Warning: group `pi' has no more members.
userdel: user pi is currently used by process 445
/usr/sbin/deluser: `/usr/sbin/userdel pi' returned error code 8. Exiting.
So I did a
ps -aux| grep 445
and I got
pi 445 0.0 0.6 9768 5944 ? Ss 13:28 0:00 /lib/systemd/systemd --user
So I have several questions.
How to know what is that process?
Supposing my new user name is gordon ..... how can I make this process not run as pi anymore and run as gordon ?
Thanks !!