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.
- Download script and navigate to the file location in the terminal application (use cd command to navigate to folder)
- 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