I have a script that adds users if you are root. But I want only one person to addusers. So how would i set uid in the script for access to root? I have tried the ksh -r in the etc passwd file and created links to all the commands. This restricts the user from any command other than what is linked.
Example script:
#!/bin/ksh
echo Enter user login information with no special characters and no longer than 8 characters and all lower case. Example: jsmith
echo Enter user login '"TURN CAPS LOCK OFF "'
read loginID
echo Enter user information: Example: Joe Smith
read username
echo Enter Group information: Example: staff
read group
echo Enter groups used by the user seperated by commas: Example: staff,dba,accounting
read groups
grep $loginID /etc/passwd
if [ $? -ne 1 ]
then
echo 'already in system '
else
echo "Adding user..." $loginID
mkuser pgrp="$group" groups="$groups" gecos="$username" shell="/usr/bin/ksh" home="/home/$loginID" $loginID
echo "Making user directory..." $loginID
mkdir /usr/$loginID
chown $loginID:$group /home/$loginID
echo "Setting unix users password for " $loginID
passwd $loginID
echo "Set password
Example script:
#!/bin/ksh
echo Enter user login information with no special characters and no longer than 8 characters and all lower case. Example: jsmith
echo Enter user login '"TURN CAPS LOCK OFF "'
read loginID
echo Enter user information: Example: Joe Smith
read username
echo Enter Group information: Example: staff
read group
echo Enter groups used by the user seperated by commas: Example: staff,dba,accounting
read groups
grep $loginID /etc/passwd
if [ $? -ne 1 ]
then
echo 'already in system '
else
echo "Adding user..." $loginID
mkuser pgrp="$group" groups="$groups" gecos="$username" shell="/usr/bin/ksh" home="/home/$loginID" $loginID
echo "Making user directory..." $loginID
mkdir /usr/$loginID
chown $loginID:$group /home/$loginID
echo "Setting unix users password for " $loginID
passwd $loginID
echo "Set password