Generally speaking, I have localadmin, which is an Administrator account, and I have X more Standard accounts. What I want to do, from this localadmin account, is change system usernames for other accounts via terminal.

Normally, this procedure would look like as if you went to System Preferences > Users & Groups and manually changed the username for those accounts.

Anyway, if you want to change username, then you will need this third-party admin account, since you are not able to change system username being on the account for what you want to change.

So, how can I change system username via terminal?

Thanks in advance!

  • What is a "third-party admin account"?
    – nohillside
    Commented Dec 22, 2022 at 15:13
  • Just admin account from which you will be changing username since it's impossible to change username of account being logged in to that account.
    – dokichan
    Commented Dec 22, 2022 at 15:15

1 Answer 1


To change the user with username user whose home folder is at /Users/user to user2 run

dscl . change /Users/user RecordName user user2

This doesn't change the user's home folder.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .