I have a script that works fine on Centos because useradd doesnt require a password to be set there and then, but the same script doesnt work on ubuntu servers as it requires this info.
I ideally want to force no password set on my script for the ubuntu servers or add a line where it sets the password during the useradd command.
If I just add sudo passwd user to my script this will only take effect after the useradd command which is too late.
Any ideas?
From
man adduser
:The default behaviour on
useradd
is to disable the password, so that one should already work.