Sponsored Content
Full Discussion: User Accounts
Top Forums Shell Programming and Scripting User Accounts Post 47639 by Sensor on Sunday 15th of February 2004 05:01:21 AM
Old 02-15-2004
Question User Accounts

I have found a script to create user accounts. But there are a few lines i dont understand. Can someone help me with this? Here's the code:

######################################

while [ $TOTAL -gt 0 ];
do
ACCT=${USER_ACCT}${START}
START=`expr $START + 1`
START=`echo ${START} | awk '{printf("%02d",$1)}'`
TOTAL=`expr $TOTAL - 1`
useradd -g ${GROUP_ID} -d ${TOP_LEVEL_DIR}/${ACCT} -c 'Student Acct' -m -s /bin/ksh ${ACCT}
(cd ${TOP_LEVEL_DIR}/coursefiles; tar cf - . | (cd ${TOP_LEVEL_DIR}/${ACCT}; tar xf -))
chown -R ${ACCT} ${TOP_LEVEL_DIR}/${ACCT}
chgrp -R ${GROUP_ID} ${TOP_LEVEL_DIR}/${ACCT}
chmod 755 ${TOP_LEVEL_DIR}/${ACCT}
echo "Account ${ACCT} created."
echo
done


ACCT=${USER_ACCT}${START_SAV}
echo "Enter the default password to use for the recently created accounts"
echo
passwd ${ACCT}
PASSWORD=`grep '^'${ACCT}':' /etc/shadow |cut -d: -f2`

START=`expr $START_SAV + 1`
START=`echo ${START} | awk '{printf("%02d",$1)}'`
TOTAL=`expr $TOTAL_SAV - 1`

while [ $TOTAL -gt 0 ];
do
ACCT=${USER_ACCT}${START}
ed /etc/shadow <<EOF
g/${ACCT}:/s/:\*LK\*:/:${PASSWORD}:
W
Q
EOF
START=`expr $START + 1`
START=`echo ${START} | awk '{printf("%02d",$1)}'`
TOTAL=`expr $TOTAL - 1`
done

######################################

Thanks!!!
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help with user accounts

I have a root access to a UNIX system. I want to create another account with administrative permissions (create users, delete them, manage print and system configuration), how do I do that? I have a Solaris 9 (SunOS 5.9) installed. Please help. :o (3 Replies)
Discussion started by: neked
3 Replies

2. UNIX for Dummies Questions & Answers

User Accounts

Hi, I was wondering if someone could tell me how to display a list of all existing user accounts on the system, not neccesarily looged in. Thanks in advance Stephen (3 Replies)
Discussion started by: sroberts82
3 Replies

3. UNIX for Dummies Questions & Answers

Creating user accounts

Hey everyone I am new to the forums and to Unix. I am currently taking a class on Unix, our teacher posed the question to us How do u create a user account without using GUI or command? We are currently running Knoppix version of Unix and for the life of me I can't figure out how this is possible.... (0 Replies)
Discussion started by: Redditt90kg
0 Replies

4. Shell Programming and Scripting

Creating user accounts

Hi, I have written a program using shell scripting. When you run the file it will asks you to enter the user name, if the user exists it says " user exists " if not it will displays like " user doesnt exist" and then asks you like " do you want to add user with options Yes or No " if you say... (1 Reply)
Discussion started by: vishwaprasad
1 Replies

5. UNIX for Dummies Questions & Answers

single user mode - user accounts passwords

hello ppl, someone must be able to help with this --> I have an old NCR tower 32 with an ADDS terminal running a unix version 020102 (Im not sure if thats correct but its unix for sure). I have no user names and no passwords and need to login to read a tape. Is there any way to do that? I hear... (3 Replies)
Discussion started by: orestis
3 Replies

6. UNIX for Dummies Questions & Answers

Difference between : Locked User Account & Disabled User Accounts in Linux ?

Thanks AVKlinux (3 Replies)
Discussion started by: avklinux
3 Replies

7. Solaris

Help with user accounts

Hi All, How to know all the shells a user has access. Thank you . (0 Replies)
Discussion started by: rama krishna
0 Replies

8. Solaris

Solaris User Accounts

Hi, Can you please tell me how to know the number of user account limit in solrise 5 version.Is there any cmd to see how many max user acc can be created. Thanks in advance (2 Replies)
Discussion started by: kkalyan
2 Replies

9. OS X (Apple)

Thunderbird user accounts

Hi All I am trying to find a way to set-up a thunderbird account by using a script, i have been trying to to add the lines into the pref.js file but it keeps getting overwritten any help would be great thanks Adam (0 Replies)
Discussion started by: ab52
0 Replies
ugweb(1M)																 ugweb(1M)

NAME
ugweb - starts the HP-UX User and Group Account Configuration tool SYNOPSIS
[ ] [ ] DESCRIPTION
The HP-UX User and Group Account Configuration tool ( ) is used to manage user accounts and group accounts on the local system. This tool can also be used to manage user accounts on a NIS system. The HP-UX User and Group Account Configuration tool provides both Web-based and terminal user interface. The Web-based interface is launched through the HP System Management Homepage. Superuser privileges are required to access the HP-UX User and Group Account Configuration tool. A user who does not have superuser privi- leges has read-only access to the Local Users, NIS Users and Groups areas in the HP-UX User and Group Account Configuration tool and cannot modify local user accounts, group accounts and NIS User accounts. An attempt will be made to connect to a Mozilla/Netscape Web browser running on the X server defined by the DISPLAY environment variable. If a running Mozilla/Netscape client is found, it will be used, otherwise a new Mozilla/Netscape session will be initiated. This will only happen if the Mozilla/Netscape process is running in the same system as that referenced by the DISPLAY variable, unless the -F option is used. Note: By default, the HP-UX User and Group Account Configuration tool (ugweb) invokes the Mozilla Web browser. If you want to support any other browser (Netscape), set the $BROWSER environment variable as shown below: The terminal user interface is invoked if any of the following conditions are true: o The command is invoked with the option. o The environment variable is not set. The Web-based interface is launched if all the following conditions are true: o The command is invoked with option. o The environment variable is set. o The command is available on the system. If the Web-based interface cannot be launched, invokes the terminal user interface. Options recognizes the following options: Forces a client browser to be used in less secure ways. The option forces the client browser to be used or started, even when the X-traffic between the X-server and the Mozilla browser is not secure. Use this option only when you are sure the network traffic between the host where Mozilla is running and the host in the DISPLAY variable is secure. If cannot start the Web browser, the terminal interface is started. When the HP-UX User and Group Account Configuration Web interface is invoked by SMH, the option is used. If a privileged user (root) executes the command with the option, a temporary login bypass key is generated. The bypass key enables the user to access the Web interface without having to provide login information again. When the HP-UX User and Group Account Configuration interface is started by SMH, the option is used. Launches the terminal interface for managing local users, NIS users and groups regardless of the current setting of the environment variable. You can also start the HP-UX User and Group Account Configuration tool using one of the following methods: o Run and select the Accounts for Users and Groups to launch the tool in Terminal User Interface mode o Start the HP-UX User and Group Account Configuration tool Web interface by typing the URL in the address bar of your browser, where hostname is the name of the server o Launch the HP-UX Systems Insight Manager on the server and select the User and Group Account Configuration tool from the Config- ure -> HP-UX Configuration menu Online Help After the HP-UX User and Group Account Configuration tool is started, the online help provides details on how to use the tool. RETURN VALUES
Upon completion, ugweb returns one of the following values: o 0 Successful o 1 An error occurred AUTHOR
was developed by Hewlett-Packard. ugweb(1M)
All times are GMT -4. The time now is 03:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy