- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- help to make a good script to create users
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2005 10:29 PM
08-28-2005 10:29 PM
help to make a good script to create users
I need to create a solution, to create a range user in a different HP-UX system 11.23.
The best idea is use one system to run a script that creates users in all others systems, with same userid, to make shore that all passwd are equal.
I have some knowledge of shell script, but I’ll like to create an interface for my script too.
I need your opinions. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2005 10:42 PM
08-28-2005 10:42 PM
Re: help to make a good script to create users
The interface needs to build the useradd command to meet your needs. Is that what you are looking for?
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Tags:
- useradd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2005 11:01 PM
08-28-2005 11:01 PM
Re: help to make a good script to create users
I have a script to run in a single system, with a simple interface using echo command. I'm trying to create a new one, with functions, more elaborated, with an interface that I can navigate, for example, with Tab key.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2005 11:03 PM
08-28-2005 11:03 PM
Re: help to make a good script to create users
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2005 11:10 PM
08-28-2005 11:10 PM
Re: help to make a good script to create users
Data format of user.dat would be
employee_code First_Name Last_name
#########################################################################
#create_user script.
#Created by Syam
#########################################################################
#!/usr/bin/sh
#
groupadd dbuser
rm -f passwords.dat
#read all the data in the file user.dat
while read data
do
#split the fields up
#first field
logid=`echo $data | cut -d' ' -f1`
#second field onwards
username=`echo $data | cut -d' ' -f2-`
useradd -c "$username" -g dbuser -m -s /usr/bin/ksh -k /etc/skel -d /home/db$logid db$logid
/usr/lbin/modprpw -x db$logid >> passwords.dat
echo "Created user $username"
done < user.dat
cat passwords.dat|cut -f2 -d"=">passwords.txt
rm -f passwords.dat
#
Regards,
Syam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2005 11:11 PM
08-28-2005 11:11 PM
Re: help to make a good script to create users
Regards,
Syam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2005 01:23 AM
08-29-2005 01:23 AM
Re: help to make a good script to create users
Well what I really need is something more elaborated how to build an interface.
And then the best code to use for create that script. My script itâ s in attachment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2005 03:49 AM
08-29-2005 03:49 AM
Re: help to make a good script to create users
korn shell with use of master.pass file on one system.
after entering name, it checks for existance and shows entry. Select if you like or choose different name. The uids are segregated. daemon uid is 100-199, normal users are 200-499, other could be 500-699, etc each with different settings for password expire etc.
Once completed the script creates a file called /tmp/new. The contents are the commands of useradd, modprpwx, etc, all the commands you would manually use. Then as this script is run as non-root user, it rcp it to either a selected system or all systems.
Then login to each system as root and run the new file with the commands.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2005 05:14 AM
08-29-2005 05:14 AM
Re: help to make a good script to create users
a friend of mine also wrote a small widget library in ksh, I've asked him for a link, as I don't remember where to find it at the moment.
florian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2005 05:32 AM
08-29-2005 05:32 AM
Re: help to make a good script to create users
http://cvs.laladev.org/index.html/laladev/lalaKSHWidgets/
I think it can do what You need.