I am trying to change the default username "pi" on my Raspberry Pi while connected via ssh. I followed instructions described here. When I logged in as root and entered this command:
root@raspberrypi:/home/pi# usermod -l newusername pi
The output was:
usermod: user pi is currently used by process 647
So I checked the process with ps -lp command:
ps -lp 647
F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD
5 S 1000 647 641 0 80 0 - 2868 poll_s ? 00:00:00 sshd
When I proceed with kill 647
, it says
Connection to 192.168.1.102 closed by remote host.
Connection to 192.168.1.102 closed.
and it will cut my ssh access to Raspberry Pi. Any ideas how to solve this issue?
usermod
this way aspi
because of a chicken and egg problem. Or (probably the best idea) you could just create a new user to run the Nextcloud server, this is the way outward facing servers are usually run unless they require root privileges (presuming it's a server and not a client you want to run).