Hello this script should get username and password from user and then create. how can i send an arguman to passwd command ?
passwd
echo "Enter username" read username useradd $username -s /bin/false echo "enter password for $username" read password passwd $username
Why don't you supply the (encrypted) password via the -p option to useradd? Use chpasswd (if available) to change passwords in batch.
ok . i want to write a script which can create username and password with 2 argumans instead of run useradd and passwd something like: sh script.sh alex alzex457 and in can create alex with password alzex457
useradd