We have an automated sync-routine that uses useradd to create new users on a Ubuntu 10.04 machine. The application launching the routine provided both username and CRYPT-encrypted password. However, since we changed how passwords are handled in order to include LDAP support, passwords now don't have to be CRYPT but can also be MD5 or SHA-1. In fact, SHA-1 is the new default. This however now causes problems.
I have read up on how /etc/shadow is handled and there doesn't seem to be an id for SHA-1, only for SHA-256/SHA-512($5$ and $6$ respectively). The only thing I found was to change the whole thing from CRYPT to SHA-1. We could do that, but we wanted the whole transition to be as non-disruptive as possible.
Is there a way to use both CRYPT and SHA-1 passwords together?
NOTES
- The main application is a CMS on an entirely different server. The linux server in question is a local machine(slave) at the client's location in order to provide local services.
- We are aware that we could switch the entire system out to use LDAP-only, but, as outlined earlier, we don't want to change everything at once.


$5$is SHA-1. Did you actually try this, and what exact problems did you encounter? – Michael Kjörling Sep 26 '12 at 9:50