| OS X - Operating System General OS operation information and support |
| Post Reply | New Thread | Subscribe |
|
|
Thread Tools |
![]() Member Since: Jun 04, 2009
Posts: 1
![]() |
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
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 |
| Thread Tools | |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
|
|||||||
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 09:50 AM.
Powered by vBulletin