Rust Installation Permission denied (os error 13)

Hello all,
I'm attempting to install rust on my Mac running Ventura 13.2. Following the instructions on the installation page, I put the following into a new terminal window:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

After the welcome to Rust messages, I choose the default installation, which results in a permission error.

Current installation options:


   default host triple: x86_64-apple-darwin
   default toolchain: stable (default)
   profile: default
   modify PATH variable: yes

1) Proceed with standard installation (default - just press enter)
2) Customize installation
3) Cancel installation
>1

error: could not amend shell profile: '/Users/yiummy/.bash_profile': could not write rcfile file: '/Users/yiummy/.bash_profile': Permission denied (os error 13)

Not sure if this is a common problem, but I couldn't find much online. Thanks!

1 Like

Can you check the permissions of /Users/yiummy/.bash_profile using ls -l /Users/yiummy/.bash_profile?

Sure thing,

ls -l /Users/yiummy/.bash_profile

returns

-rw-r--r--  1 root  staff  447 Mar 28  2022 /Users/yiummy/.bash_profile

in the command line.

For some reason .bash_profile is incorrectly owned by root rather than your own user. Try sudo chown yiummy:staff /Users/yiummy/.bash_profile.

1 Like

Yes, thank you! I found something similar online that indicated it was a root ownership issue too. I used

sudo chown yiummy ~/.bash_profile

instead, but I imagine it accomplished the same thing. Thanks again!

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.