Em vez de useradd
, use o comando adduser
, que executa automaticamente passwd
quando você o chama, a menos que você use os sinalizadores --disabled-login
ou --disabled-password
.
Execução da amostra:
$ sudo adduser pixie
Adding user 'pixie' ...
Adding new group 'pixie' (1001) ...
Adding new user 'pixie' (1001) with group 'pixie' ...
Creating home directory '/home/pixie' ...
Copying files from '/etc/skel' ...
Enter new UNIX password: # password does not show
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for pixie
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] y