Skip to content

@scottd3v scottd3v released this Aug 30, 2018 · 1116 commits to master since this release

Script to rename a user account on MacOS

The script updates the users record name (username) and home directory.

If the user receiving the name change is signed in they will be signed out.

Prior to running the script on MacOS 10.14 or later the terminal application must be granted permissions to the "Full Disk Access" category in the System Preferences "Security & Privacy" pane due to new user data protections introduced in macOS 10.14.

The terminal application can be found in the "Utilites" folder nested within the "Applications" folder.

Screenshot:

screen shot 2018-09-27 at 2 56 13 pm

Example usage:

  1. Download script and navigate to the file location in the terminal application (use cd command to navigate to folder)
  2. Run command:
sudo sh RenameMacUserNameAndHomeDirectory.sh cat dog

Above example would rename account cat to dog

NOTE: SCRIPT MUST BE RUN AS ROOT
NOTE: SYSTEM WILL RESTART AFTER SUCCESSFUL NAME UPDATE

YouTube example of Mac rename script in action

Assets 3
You can’t perform that action at this time.