Go Back   The macosxhints Forums > OS X Help Requests > UNIX - General



Reply
 
Thread Tools Rate Thread Display Modes
Old 07-13-2004, 12:57 PM   #1
rnickerson
Prospect
 
Join Date: Jun 2004
Posts: 5
Question Add user account via shell script?

Hello,

I have 100+ Macs running OS 10.3.4 and the Apple Remote Desktop 2 client. We are not using any directory services (don't ask me why, I just work here :-) ), so I need to add a local account to each machine. I have the ARD2 client install and I can administer most functions remotely, but the ARD2 admin application dosen't provide a way to add user accounts to groups of machines.

I figured I'd copy and run a shell script on each machine to add the required account. The problem is that although I can use the niutil utility to add the user account information to the NetworkInfo DB, I can't seem to set the password using this utility. I could run the passwd command to set the password, but this needs to receive stdin input to enter and re-enter the password - which I'm not sure I can do in the script. Any ideas? Thanks in advance...
rnickerson is offline   Reply With Quote
Old 08-19-2004, 02:12 AM   #2
ssevenup
Triple-A Player
 
Join Date: Jan 2002
Posts: 56
Afp548

Try posting this question on the afp548.com forums.

--MM
ssevenup is offline   Reply With Quote
Old 08-19-2004, 08:34 AM   #3
hayne
Site Admin
 
Join Date: Jan 2002
Location: Montreal
Posts: 32,387
I think there was an article about an 'add_user' script on the main macosxhints site.
hayne is offline   Reply With Quote
Old 08-19-2004, 09:16 AM   #4
trevor
Moderator
 
Join Date: Jun 2003
Location: Boulder, CO USA
Posts: 19,804
Create new user from the command line (link currently doesn't have script, just a promise that it will be up in a few days)

A thread on the subject

Trevor
trevor is offline   Reply With Quote
Old 08-19-2004, 10:09 AM   #5
ssevenup
Triple-A Player
 
Join Date: Jan 2002
Posts: 56
10.2 only

I think you will find that most scripts and discussions about adding users at the command line refer to Jaguar only. Panther has added some new fields to Netinfo for user accounts and more importantly migrated from "crypt" passwords to more secure methods. As a result, as far as I know the passwd utility is a requirement as is stdin to double enter the password. I don't know of a way to automate the process with a script. I wrote a script for Panther to add accounts but it requires you to double enter a password. I also slapped a GUI front end onto the script but it requires you to password the account after the account is created to "activate" it. This was deamed OK because we often create accounts that need to be left inactive until the user has completed the security requirements. The passwd utility by the way does not have the ability to change the keychain password so using passwd on an existing account will break the mechanism that unlocks the keychain when they log in.

--MM
ssevenup is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 09:34 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.