Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
Apple Computing Products:
macOS - Operating System
Script for adding users
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="i_eat_short_ppl" data-source="post: 855027" data-attributes="member: 104177"><p>1. I tried creating this script to add users through bash from these two sites, <a href="http://www.geektimes.com/macintosh/os/x/10_3/and/add_user_script.html" target="_blank">Mac OS X: Creating a new user from the command-line</a> and <a href="http://osxdaily.com/2007/10/29/how-to-add-a-user-from-the-os-x-command-line-works-with-leopard/" target="_blank">How to: Add a user from the OS X command line, works with Leopard! - OS X Daily</a>. 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.</p><p>[CODE]#!/bin/sh</p><p>echo "Enter username: "</p><p>read newuser</p><p>echo "Enter the full name for user $newuser: "</p><p>read long_name</p><p>echo "Enter password for $newuser: "</p><p>read password</p><p>new_uid=`nidump passwd . | awk -F: '{print $3f}' | sort -n|tail -1`</p><p>new_uid=`expr $new_uid + 1`</p><p>dscl / -create /Users/$newuser</p><p>dscl / -create /Users/$newuser UserShell /bin/bash</p><p>dscl / -create /Users/$newuser RealName "$long_name"</p><p>dscl / -create /Users/$newuser UniqueID $new_uid</p><p>dscl / -create /Users/$newuser PrimaryGroupID (ADD NAME OF GROUP HERE)</p><p>dscl / -create /Users/$newuser NFSHomeDirectory /volumes/(ADD EXTERNAL HARD DRIVE NAME HERE)/Users/$newuser</p><p>dscl / -passwd /Users/$newuser $password[/CODE]</p><p>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?</p><p>3. Is the openSSH sever for mac good?</p><p>4. Can anyone recommend a client that is easy to use for a non-technical person?</p></blockquote><p></p>
[QUOTE="i_eat_short_ppl, post: 855027, member: 104177"] 1. I tried creating this script to add users through bash from these two sites, [url=http://www.geektimes.com/macintosh/os/x/10_3/and/add_user_script.html]Mac OS X: Creating a new user from the command-line[/url] and [url=http://osxdaily.com/2007/10/29/how-to-add-a-user-from-the-os-x-command-line-works-with-leopard/]How to: Add a user from the OS X command line, works with Leopard! - OS X Daily[/url]. 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[/CODE] 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]
Verification
Post reply
Forums
Apple Computing Products:
macOS - Operating System
Script for adding users
Top