linux add user with home directory 1

linux add user with home directory

useradd -m $username

Here is what the above code is Doing:
1. We’re creating a variable called username and assigning it the value of the first argument passed to the script.
2. We’re creating a variable called password and assigning it the value of the second argument passed to the script.
3. We’re using the useradd command to create a new user with the username stored in the username variable.
4. We’re using the echo command to print the username and password to the screen.

Similar Posts