Use the dscl command. This example would create the user “luser”, like so:
dscl . -create /Users/luser
dscl . -create /Users/luser UserShell /bin/bash
dscl . -create /Users/luser RealName "Lucius Q. User"
dscl . -create /Users/luser UniqueID "1010"
dscl . -create /Users/luser PrimaryGroupID 80
dscl . -create /Users/luser NFSHomeDirectory /Users/luser
You can then use passwd to change the user’s password, or use:
dscl . -passwd /Users/luser password
You’ll have to create /Users/luser for the user’s home directory and change ownership so the user can access it, and be sure that the UniqueID is in fact unique.
This line will add the user to the administrator’s group:
dscl . -append /Groups/admin GroupMembership luser
Related Posts:
- How to start/stop/restart launchd services from the command line?
- Can Mac OS X be run inside Docker? [closed]
- How do I set the global PATH environment variable on OS X?
- How can I find the path to an executable in OSX
- How to restart Nginx on Mac OS X?
- Why is rsync skipping the main directory?
- Can I specify a port in an entry in my /etc/hosts on OS X? [duplicate]
- When is K 1024 and when is it 1000?
- Dial pad to get phone number (with Android button images)
- Why is it not possible to fake an IP address?
- Authentication versus Authorization
- What is tail recursion?
- Visual List of iOS Fonts?
- How to get rid of the “No bootable medium found!” error in Virtual Box? [closed]
- ‘git’ is not recognized as an internal or external command
- How can I write a `try`/`except` block that catches all exceptions?
- How do I decompile a .dll file?
- What’s the purpose of git-mv?
- How to write trycatch in R
- how to use proxy on youtube-dl?
- SSH -X “Warning: untrusted X11 forwarding setup failed: xauth key data not generated”
- LINQ equivalent of foreach for IEnumerable
- How to do vlookup and fill down (like in Excel) in R?
- Using “super” in C++
- What is the difference between application server and web server?
- Were jprobes removed from kernel v4?
- ldap_sasl_bind(SIMPLE): Can’t contact LDAP server(-1)
- PHP – Failed to open stream : No such file or directory
- How to extract the substring between two markers?
- Code-first vs Model/Database-first
- How to resolve git’s “not something we can merge” error
- Even though JRE 8 is installed on my MAC -” No Java Runtime present,requesting to install ” gets displayed in terminal
- What fonts can I use with pygame.font.Font?
- CSS Box Shadow Bottom Only
- How to squash all git commits into one?
- how to fix Javac invalid flag error?
- PHP & MySQL: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given
- “Insert if not exists” statement in SQLite
- Web API Error – This request has been blocked; the content must be served over HTTPS
- How can I delete all of my Git stashes at once?
- How to create temp table using Create statement in SQL Server?
- Error while trying to retrieve text for error ORA-01019
- What is meant by diameter of a network?
- What is the “N+1 selects problem” in ORM (Object-Relational Mapping)?
- HTML Best Practices: Should I use ’ or the special keyboard shortcut?
- What is runtime in context of Python? What does it consist of?
- mount.nfs: requested NFS version or transport protocol is not supported
- How do you get the file size in C#?
- how to use svm in Weka Classsifier?
- MIPS ‘nor’ usage in code
- How can I center
- into a div?
- Popup window in PHP?
- LaTeX table too wide. How to make it fit?
- R Markdown – changing font size and font type in html output
- git add only modified changes and ignore untracked files
- HTTP Error 404.3-Not Found in IIS 7.5
- Multiplying a register value by a constant in MIPS?
- What’s the use of the staging area in Git?
- Getting DOM element value using pure JavaScript
- What is the difference between lemmatization vs stemming?
- Instagram how to get my user id from username?
- Procedural and non-procedural query language difference
- COM object that has been separated from its underlying RCW cannot be used
- Swift 2: !, ? -” Value of optional type “…” not unwrapped”
- R: NaNs produced
- What is a .meta file and why does Unity create them for all of my assets?
- Center div on the middle of screen [duplicate]
- Which function grows faster, exponential or factorial?
- How to calculate Internet checksum?
- How to get the vector between two vectors?
- XML Error: Extra content at the end of the document
- Error: You need to include some adapter that implements __karma__.start method
- ggplot facet_wrap: At least one layer must contain all variables used for facetting
- Child theme on style.min.css
- Refresh admin page after woocommerce order received
- jquery anchor effect does not work properly
- Import local site to WordPress.com
- Can I make the post type value dynamic in ajax.php in wordpress
- Posts feed number of posts
- How can I debug what is wrong ? Featured images stopped showing
- Add link to php field text on wordpress form
- Bootstrap theme embedded iframes are distorted [closed]
- To remove rendering of menus and header, plugin or theme?
- 100% uptime for a web application
- How to assign permissions to ApplicationPoolIdentity account
- Is it bad to redirect http to https?
- Using DD for disk cloning
- What tool do you use to monitor your servers?
- Sudo as different user and running screen
- What is the difference between Load Balancer and Reverse Proxy?
- Should servers be turned off at night?
- Where to check log of sendmail?
- How can I see Time-To-Live (TTL) for a DNS record?
- How to inspect remote SMTP server’s TLS certificate?
- Choosing between meaningful and meaningless hostnames [closed]
- logrotating files in a directories and its subdirectories
- Multiple TXT fields for same subdomain
- Do SPF Records For Primary Domain apply to subdomains?
- Why is the response on localhost so slow?
- apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName