Security is a big name for a retrogaming OS. Batocera is not a designed to be a secure OS. Don't expose it to the open Internet: you are warned and you will take all responsibility for what happens.
There is the option to Enforce Security in Batocera; this will have three effects upon rebooting:
linux to a randomly generated password, which you can see in System Settings, Security section.root and the passwordHowever, if you want to change the password yourself you can go to Main Menu > System Settings > Security > Root Password.
If you would like to do this over SSH:
batocera-config setRootPassword [password] (replace [password] with the password you want).batocera-config getRootPassword command to see if your changes were applied.The Samba protocol (Batocera's userdata network share) as a whole is a major attack surface and should not be trusted on a public network at all (even if Enforce Security is turned on). This is among other features Batocera has turned on by default that pose as a security-risk. The gist of it is this: only connect your Batocera machine to your trusted home network, behind a firewall.
Certain actions, such as adding or removing an ethernet network interface, may cause the password to be randomized on the next reboot! Be sure to have another way to access the system if an unexpected randomization occurs, such as Password-less authentication