- $ sudo passwd root
sudo passwd root
[enter new ridiculous root password. Remember it.] - Log/ssh into pi as root using ridiculous password.
- $ usermod -l newname -d /home/newname -m oldname
usermod -l newname -d /home/newname -m oldname
- $ ls -al /home/
ls -al /home/
[See that you've changed the user & home folder. Yay. Oh.. gotta change the group...] - $ groupmod --new-name newname oldname
groupmod --new-name newname oldname
- $ ls -al /home/
ls -al /home/
[See that user, group & home folder are changed. Yay!] - $ exit
exit
(Now log in as newname. Yay!)
But wait....
Now you should reset root so others can't brute-force your ridiculous password. - $ sudo passwd -l root
sudo passwd -l root
(Oh, and if you REALLY care... edit /etc/ssh/sshd_config/etc/ssh/sshd_config
, setting "PermitRootLogin no", and restart that service.)
Then you'll have to change any additional changes in any scripts/setups that refer to 'pi'... JOY.