I have to do the following in a shell script:
1. Create a new user. Ask for the username, full name, and password. Then use this information to create a new user in the system.
2. Backup an entire partition. Ask for the partition name (directory associated with that partition) and the target location to save the backup file. Then make a copy of that directory in the desired location as a single archive file, with current date as the file extension.
This is what i have so far:
Code:
read input
case $input in
1)
echo "Enter Username:"
read username
echo "Enter Full Name:"
read name
echo "Enter password:"
read pass
sudo useradd -m $user
sudo passwd $user
echo "User added"
;;
2)
echo "Enter partition name:"
read partName
echo "Enter target location:"
read location
dump 0u $location $partName
echo "Done"
;;
For the first one, it creates a user but Im not able to log in to it. Also is there a way to assign the user the password the user enters?
I have no clue on how to do the second part.