Re: Home Folder Name Change
Re: Home Folder Name Change
- Subject: Re: Home Folder Name Change
- From: llee040 via AppleScript-Users <email@hidden>
- Date: Wed, 13 May 2020 12:30:31 -0500
> On May 12, 2020, at 7:02 PM, Gil Dawson via AppleScript-Users
> <email@hidden> wrote:
>
> Hi--
>
> I used Migration Assistant to copy from my 2009 MacBook Pro with onto a newer
> 2015 MacBook Pro.
>
> Somehow in the process my home-folder-name (is that the right term?) got
> changed from "gil" to "gil 1"
>
Yes, although unpersonalized script constructs are definitely preferable, I
think you may also find it preferable to rename the home folder to what you’re
used to. For one thing, many solutions that you may want to use may not
consider the possibility of having a space in the home folder name.
I haven’t done this in a while, so I decided to rename my own to see what
actions might be needed.
The renaming part was actually pretty simple. Mine was named “lee”, so I
renamed it to a form comparable to what yours is named now. After that was
completed with no problems, including a restart, I changed the name back again.
I think the latter process (changing back) would be more in line with what you
need, so I’ll use that in my examples.
I’m using Mojave. This should work for Catalina as well. Your account must be
an admin account.
First be sure there’s no folder in /Users that has the name your home folder
name will become. I didn’t have a “lee” folder in /Users, so that was not a
problem. If you still have a “gil” folder in /Users, that may cause a problem
if that folder contains the data that you want to use for your account. If not,
then you can just delete the folder. If an account uses that folder as home,
then you should use the Users & Groups prefpane to delete the account or
archive it.
I should mention that I wasn’t able to use the instructions provided in the
article https://support.apple.com/en-us/HT201548
<https://support.apple.com/en-us/HT201548>, because Finder would not let me
rename my home folder, I had to use Terminal (this was true whether SIP was
disabled or enabled, but I digress). I don’t have Sharing enabled at all,
either. I think that the article may contain some outdated information.
I opened the Users & Groups prefpane, unlocked it, then right-clicked the lee
account, and clicked “Advanced Options…”. I left that sheet open, then launched
Terminal and ran:
sudo mv /Users/‘lee 1’ /Users/lee
If I understand your situation correctly, your command would be:
sudo mv /Users/‘gil 1’ /Users/gil
After I entered my admin password, the folder was renamed. I closed Terminal,
then switched to the System Preferences sheet already open. I changed the
contents of "Home Directory:" text field to “/Users/lee” by typing.
I clicked OK, then accepted the prompt to restart, then logged into the “lee”
account.
That was all that was needed.
Under some circumstances, that might not be enough to make things right again,
so here are additional commands to consider running while logged in as “lee”
(in your case “gil”), and they should be run in this order. I ran each of them
just to be sure. Keep in mind that the ACL commands may reference folders that
you don’t have. They were created a long time ago, and, although they’ll cause
no harm, probably won’t be needed. The main thing is that I believe you should
own everything in your home folder, regardless of how things may be installed
on recent systems. That’s accomplished using this Terminal command.
sudo chown -R `id -un` ~
In your case you could make it
sudo chown -R gil ~
SIP will interfere with that command for some items. You really shouldn't have
to bother about items for which "Operation not permitted" is returned (as I
said, I want to own everything in my Home folder, so I disabled SIP and ran the
command again -
https://www.imore.com/how-turn-system-integrity-protection-macos - then
re-enabled SIP).
If you like, you can work with ACLs (probably not needed, and you may not even
have all the specified folders).
My home folder has been passed down through many generations, so I ran each of
them.
chmod -RN ~
chmod +a "everyone deny delete" ~/ ~/Desktop ~/Documents ~/Downloads ~/Library
~/Movies ~/Music ~/Pictures ~/Public ~/Sites
chmod +a "`id -un` allow
list,add_file,search,delete,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity,writesecurity,chown,file_inherit,directory_inherit"
~/Public/'Drop Box'
Laine Lee
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden