Skip to content

Mac Account Rename Script

Compare
Choose a tag to compare
@scottd3v scottd3v released this 30 Aug 18:21
· 4822 commits to master since this release
c9d271c

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