The name of your macOS user account and the name of your home folder must both be the same. Changing these names does not change or reset the password of your user account.
Because doing this incorrectly could damage your account and prevent you from logging in, you should back up your important data before proceeding.
First rename the home folder
- Log out of the account you're renaming, then log in to a different administrator account. (If you don't have another administrator account, you can create one in Users & Groups preferences.)
- Open the Users folder on the startup disk. It contains the home folder for each user. To get there, you can choose Go > Go to Folder from the menu bar, then enter
/Users
. - Rename the user's home folder without using any spaces in the new name. You'll be prompted to enter the administrator name and password that you used to log in. If you're using file sharing to share the home folder, you won't be able to rename it until you stop sharing the folder.
Using Terminal. To enter shell commands or run server command-line tools and utilities, you need access to a UNIX shell prompt. Both Mac OS X and Mac OS X Server include Terminal, an application you can use to start a UNIX shell command-line session on the local server or on a remote server. Outside of this chapter, this document does not generally cover the C shell syntax. If after reading this, you still want to write a more complex script using the C shell programming language, you can find more information in on the C shell in the manual page for csh. Shell Variables and Printing. Shell Script Commands echo - Displays messages or turns command echoing on or off for/endfor - Executes commands for each item in a set of items goto - Makes batch file execution jump to another location if/endif - Executes commands in specified conditions.
Then rename the account
While still logged out of the account you're renaming, follow these additional steps:
- Choose Apple () menu > System Preferences, then click Users & Groups.
- Click , then enter the administrator name and password that you used to log in.
- From the list of users on the left, Control-click the user you're renaming, then choose Advanced Options.
- Change the “Account name” field to match the new name of the home folder. It should have no spaces.
- The account name also appears in the “Home directory” field, after
/Users/
. Change that account name to match the new name of the home folder. - If you want to change the full name associated with your account, update the ”Full name” field as well. It can be any name, and you can use either the full name or the account name to log in to your Mac or make changes that require your name and password.
- Click OK, then restart your Mac.
- Log in to the renamed account, then verify that your old files and folders are visible and the account is working as expected.
EDIT: This is a WNDR3700v4 from NETGEAR, so it's using an Atheros chip.
So I would like to either figure out how to automatically change my MAC on a set timer through scripting, or just how to change the MAC at all through shell.
I have no knowledge of Linux but I have done it through Windows via command prompt but that's pretty much it.
Sorry for lowkey asking for a spoonfeeding but I did some google searches to see if anyone has tried to change the MAC address through SSH and didn't quite see anything that made me feel confident enough to venture about without the worry of bricking my router.
Burgi1 Answer
Your question divides into two parts: How to change a MAC address, and how to time a certain process.
Change MAC address
Change Mac Shell Manual Download
Given you cannot install nice utilities like macchanger
, you will have to do this manually.
Find out your network interface name. In many cases this is
eth0
. Be sure to find the name of the interface you really want to change (WAN or LAN, VLAN...). In this example, I'll useeth0
Check your current MAC address
ip link show eth0
. It may show something likelink/ether 00:11:22:33:44:55
Take down your interface:
ip link set dev eth0 down
. This is a large disadvantage of this solution because it tears down the whole network during the process. Be sure you really want this to happen.Set a new MAC address:
ip link set dev eth0 address AA:BB:CC:DD:EE:FF
Take your interface up again:
ip link set dev eth0 up
Make a script of it
In a script, this might look like this:
Save this script to a fitting location (let's assume /root/mac.sh
) and make it executable by chmod +x /root/mac.sh
.
You can test your script by executing /root/mac.sh
.
Time running processes by cron
Mac Makeup Shell
With cron
you can make processes run on a regular basis, for example once a day.
Edit your cron file by
crontab -e
Insert a line giving the necessary information: When and what. For example
0 1 * * * /root/mac.sh
. This would execute the command every day, month, year at 01:00. Please check the cron help pages for information on how to set it to different intervals.
Change Mac Shell Manual Download
Please be sure to edit the crontab file as root.