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?