Recently I had a hack try on my server and someone from this forum gave me some solutions to protect my server from hack.
A trick is to not use defaults users, for example pi for the raspberry. The problem is when I started to configure my server I didn't created a new user and I did all with the default user pi.
What I want to do is just rename the pi user. But I want that all his rights and folders (for example the home directory), and even the ssh account too.
Can I made it simply with the usermod command ? Nothing will be forget ?
Also is it possible to do it through ssh connected to the pi account ? (I will use the su command to change my identity from pi to root, but the ssh connection will still belong to the pi user, no ?)