- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: user add
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
Forums
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
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
09-16-2003 03:23 AM
09-16-2003 03:23 AM
user add
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2003 03:28 AM
09-16-2003 03:28 AM
Re: user add
It is difficult to post a script here, if you don't want to use "useradd", as so many people would do this in different ways.
I suspect the best thing would be do a short script to keep track of the next free UID and put that as a variable to the "useradd" command.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2003 03:30 AM
09-16-2003 03:30 AM
Re: user add
Take a look at the command useradd and userdel.
Hope it helps,
Robert-Jan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2003 03:33 AM
09-16-2003 03:33 AM
Re: user add
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2003 03:44 AM
09-16-2003 03:44 AM
Re: user add
#!/bin/sh
for i in `cat /tmp/newusers.lst`
do
USER=`echo $i | awk -F":" '{print $1}'`
UID=`echo $i | awk -F":" '{print $2}'`
GROUP=`echo $i | awk -F":" '{print $3}'`
DIR=`echo $i | awk -F":" '{print $4}'`
SHELL=`echo $i | awk -F":" '{print $5}'`
/usr/sbin/useradd -u $UID -g $GROUP -d $DIR -s $SHELL $USER
if [ $? -eq 0 ]
then
/usr/bin/passwd $USER
fi
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2003 05:48 AM
09-16-2003 05:48 AM
Re: user add
user field to = Yusername
passwd =*.NP*
comment = user disabled
shell= /bin/false
i have written a sed script which is changing the first field only ..now i wanna change passwd , comment and shell field.I am pastiniog the script below ..for suggestions /modifications ..
#!/usr/bin/ksh
#usage :scriptname passwdfilename
set -x
for x
do
echo "enter the user name \c"
read user1
echo "the user name to be disabled is $user1"
grep "^${user1}:" $x
if [ $? -eq 0 ]
then
sed '/^'$user1':/ {
s/'$user1'/X'$user1'/
}' $x
else
echo "please enter the correct user name as $user1 does not exist in the $x"
fi
done
~
~
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2003 05:49 AM
09-16-2003 05:49 AM
Re: user add
You'll see all kinds of cool code, some of it commented.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com