Is there a way to reset the keyboard settings from the Terminal since
I’m unable to login into any account?
This post on Ask Different explores different ways of dealing with this when logged into Mac OS X. But if you are logging in via the Terminal in “Recovery Mode” you would have to adjust those procedures to match acting on a different volume.
For example, while that question and answer thread points to acting on this file:
But note that
~/ refers to your user’s home directory. But when you are logging in via the Terminal in “Recovery Mode,” you are not booting into your volume or even your user—obviously—but rather you are booting into a separate partition.
So you can adjust your user’s items on the system, but you need to modify paths so you can act on the files on your core system. So when you are logged in via the Terminal in “Recovery Mode” run this command:
That will list all connected volumes associated with your machine. Now note your system’s true volume name which might be something like
Hard Disk/. With that noted, you can then find your
com.apple.HIToolbox.plist by exploring a path like this:
ls /Volumes/Hard\ Disk/Users/[username]/Library/Preferences/com.apple.HIToolbox*
Of course change
[username] to match your username. So if it were just
josh then the
ls command would be:
ls /Volumes/Hard\ Disk/Users/josh/Library/Preferences/com.apple.HIToolbox*
Once you know what file you would be acting on, I would recommend a brute force renaming of that file—rather than editing—to force the system to regenerate the
com.apple.HIToolbox.plist. I would proceed like this by first going into that directory:
cd /Volumes/Hard\ Disk/Users/josh/Library/Preferences/
Then renaming the file like this:
mv com.apple.HIToolbox.plist com.apple.HIToolbox.plist.old
The act of simply naming the file
com.apple.HIToolbox.plist.old will make it effectively unknown to the system. So a new
com.apple.HIToolbox.plist should be regenerated. And by simply renaming it—instead of just deleting it—you have a backup just in case something breaks.
Now all that said, I am not 100% sure dealing with
com.apple.HIToolbox.plist would solve the issue. But at leas you now know that when you are using the Terminal in “Recovery Mode” you need to explicitly navigate to the file system of the main OS install to do any tweaks and adjustments.