Hi all.
I have a problem.
How to create a new user to the sh-script?
I have:
But after the command:
- in the console message
How to automate?
Thanks.
I have a problem.
How to create a new user to the sh-script?
I have:
Code:
#!/bin/sh
#(c) 2011 doorways :).
if [$(id -u) -eq0 ]; then
echo "Enter your name: "
read user_name
echo "Enter your password: "
read user_password
mkdir -p /usr/home/$user_name
chmod 777 /usr/home/$user_name
epass=`perl -e 'print crypt ("'$user_password'", "sa");'`
adduser -m -d /usr/home/$user_name -p $epass $user_name
else
echo "You are must be root!"
fi
# end file.
But after the command:
Code:
adduser -m -d /usr/home/$user_name -p $epass $user_name
- in the console message
Code:
Username:
…
Thanks.