- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Automated user additions
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
02-23-2005 12:00 AM
02-23-2005 12:00 AM
Please let me know.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2005 12:08 AM
02-23-2005 12:08 AM
Re: Automated user additions
That should certainly work, but I would use Expect to automate that kind of job. Any reason you wouldn't use Expect?
Also, are you looking for script examples?
-dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2005 12:09 AM
02-23-2005 12:09 AM
Re: Automated user additions
Here is a working shell to build on.
temppass=Change1
while read -r username
do
useradd $username
passwd <
$temppass
$temppass
EOF
done < list
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2005 12:22 AM
02-23-2005 12:22 AM
Re: Automated user additions
What is Expect?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2005 12:27 AM
02-23-2005 12:27 AM
Re: Automated user additions
-dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2005 12:34 AM
02-23-2005 12:34 AM
Re: Automated user additions
At a time savings of a few minutes per server, it really adds up after about 20.
-dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2005 12:36 AM
02-23-2005 12:36 AM
Re: Automated user additions
Is Expect a software package, if so where can I review it?
Thanks,
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2005 12:38 AM
02-23-2005 12:38 AM
SolutionExpect is apparently included in most UNIX OSes these days. You should be able to do a "man expect" from your UNIX command prompt. If not, I believe you can view it here:
http://expect.nist.gov/
-dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2005 01:37 AM
02-23-2005 01:37 AM
Re: Automated user additions
checking host system type... Invalid configuration `hppa2.0n-hp-hpux11.00': machine `hppa2.0
n-hp' not recognized
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2005 02:43 AM
02-23-2005 02:43 AM
Re: Automated user additions
Anyone care to help???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2005 02:50 AM
02-23-2005 02:50 AM
Re: Automated user additions
http://hpux.cs.utah.edu/hppd/hpux/Tcl/expect-5.42/
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2005 03:52 AM
02-23-2005 03:52 AM
Re: Automated user additions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2005 12:37 AM
02-24-2005 12:37 AM
Re: Automated user additions
Build a list of ip addresses you want users added to in a file called /tmp/iplist.txt
Run the following script on this server. This script will put the list of accounts to be added on each server.
NOTE: on line 3,is a root equivilant account that is on every server. Adduser is the account name and passwd is the actual passwd.
cat /tmp/iplist.txt | while read line | do;
if [ -s /tmp/iplistt.txt ]; then
/ftp -inv $line << EOF
user adduser passwd
pwd
bin
prompt
ls $FILE
get $FILE
quit
EOF
else
continue
done
echo "...ftp: ended"
Build the file (/tmp/account.list) in this format:
Account Name:Gecos Name
Run the ftp script.
Now all that is needed is to run a telnet script to add the users.
I have not had a need for this so this part needs a little work.
On each server you can run the following:
Cat /tmp/account.list | while read line| do
echo $line | IFS=":" read id gecos
useradd $id â c $gecos
done
You can also add entries to automatically age them, (such as â x 60 to age out in 60 days).
What you can do is run the scripts in cron.
On every server, run the useradd script at 22:00 every night.
On the one server pushing the lists run the ftp script at 21:00.
You would have to modify the /tmp/account.list file daily, but it would be a one time thing and would add the users.
If no one needed to be added leave the file e
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2005 12:43 AM
02-24-2005 12:43 AM
Re: Automated user additions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2005 06:14 AM
02-24-2005 06:14 AM