sync is one of the user account created by Debian itself. I'm wondering why Debian sets its login shell to
/bin/sync instead of
/bin/false. How does Debian use this user account?
This is documented in
The shell of user
/bin/sync. Thus, if its password is set to something easy to guess (such as ""), anyone can sync the system at the console even if they have no account on the system.
This is really a historical artifact, I wouldn't expect a
sync user to be set up in this way nowadays. In the past it would be useful to have such a user so that people with physical access to a console (e.g. in a server room or a lab full of workstations, as you'd find in universities) could reduce the risk of data loss when shutting down a system (to recover from a rogue process or simply to use the workstation, if it had been left locked by its previous user). Unix systems before Debian tended to have a
sync user and a
shutdown user with which you could actually shut a system down properly without knowing the
root password. (On our Sun SPARCstations we'd just STOPA
It's worth noting, as Peter Cordes mentioned, that other mechanisms are available on many systems to ensure safe shutdowns or reboots from a console without being able to authenticate as
root: ACPI events triggered by pressing the power switch (which lead to a clean shutdown), or CtrlAltDel (which leads to a clean reboot). AltSysRq can be used as a last resort to sync, kill, unmount and reboot, but it's not a clean reboot. As mentioned by JdeBP, having a
sync user is a very old idea, dating back at least to the early 1980s.