New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Operating System General OS operation information and support

OS 10.5 - Script for adding users


Post Reply New Thread Subscribe

 
Thread Tools
i_eat_short_ppl

 
Member Since: Jun 04, 2009
Posts: 1
i_eat_short_ppl is on a distinguished road

i_eat_short_ppl is offline
1. I tried creating this script to add users through bash from these two sites, Mac OS X: Creating a new user from the command-line and How to: Add a user from the OS X command line, works with Leopard! - OS X Daily. The important thing about the script is that it creates the user's home directory on an external hard drive connected to the computer. I would like to know if this script will work, as I don't have mac myself and am writing this script for someone else. If this doesn't work, could you please suggest a script that will work.
Code:
#!/bin/sh
echo "Enter username: "
read newuser
echo "Enter the full name for user $newuser: "
read long_name
echo "Enter password for $newuser: "
read password
new_uid=`nidump passwd . | awk -F: '{print $3f}' | sort -n|tail -1`
new_uid=`expr $new_uid + 1`
dscl / -create /Users/$newuser
dscl / -create /Users/$newuser UserShell /bin/bash
dscl / -create /Users/$newuser RealName "$long_name"
dscl / -create /Users/$newuser UniqueID $new_uid
dscl / -create /Users/$newuser PrimaryGroupID (ADD NAME OF GROUP HERE)
dscl / -create /Users/$newuser NFSHomeDirectory /volumes/(ADD EXTERNAL HARD DRIVE NAME HERE)/Users/$newuser
dscl / -passwd /Users/$newuser $password
2. Do users need to be in a group? If so, how could I create a group with no privileges to that the users can only open their home directories on the external hard drive?
3. Is the openSSH sever for mac good?
4. Can anyone recommend a client that is easy to use for a non-technical person?
QUOTE Thanks

Post Reply New Thread Subscribe


« script editor format | ** time machine utility »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Same iTunes under 2 accounts lardyboy Music, Audio, and Podcasting 6 01-16-2008 08:22 PM
Just How Secure Are the 'Reset Safari' & 'Erase Free Space' Facility? scoot OS X - Operating System 3 05-30-2007 05:28 PM
apple script to greet me off stand by jakeroberts OS X - Development and Darwin 0 04-29-2007 12:34 PM
Sky by Broadband not available to Mac users: please complain TimandJane06 Schweb's Lounge 1 07-09-2006 09:56 AM
Mac Users Get More ISP Choices schweb Apple Rumors and Reports 1 03-06-2003 10:57 AM

All times are GMT -4. The time now is 12:38 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?