命令行创建Mac OS账户

Mac Add a User From Terminal Mac

Step 1

Open a Terminal window. Click the "Go" pull-down at the top of the Finder, select "Utilities" and double-click the "Terminal" icon.

Step 2

Type "sudo dscl . -create /Users/username" and press "Enter." Replace "username" with a one-word name to identify the user. Replace all instances of "username" in future steps with the same one-word name. Enter your computer's administrator password and press "Enter" again. The prompt drops to the next line.

Related Reading: How to Configure iChat for Desktop Sharing in Mac OS X

Step 3

Type "sudo dscl . -create /Users/username UserShell /bin/bash" and press "Enter."

Step 4

Type "sudo dscl . -create /Users/username RealName "John Smith"" and press "Enter." Replace "John Smith" with the new user's full name.

Step 5

Type "sudo dscl . -create /Users/username UniqueID 1001" and press "Enter." The number after "UniqueID" must be an ID number that is not assigned to another user.

Step 6

Type "sudo dscl . -create /Users/username PrimaryGroupID 1000" and press "Enter."

Step 7

Type "sudo dscl . -create /Users/username NFSHomeDirectory /Local/Users/username" and press "Enter." This creates a home folder for the new user.

Step 8

Type "sudo dscl . -passwd /Users/username password" and press "Enter." Replace "password" with the desired password that the new user will use when logging in to the computer. You may need to type your computer's administrator password again to complete this action.

Step 9

Type "sudo dscl . -append /Groups/admin GroupMembership username" and press "Enter" to give the new user administrative privileges. To make the new account a limited user account, skip this step.

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值