Add canister access control for another computer

When creating a canister, one gets a default identity that becomes the owner of the canister.
What if my computer breaks or I want to manage the canister from another computer?

How do I copy the ‘default’ identity so that it is useable elsewhere?

1 Like

You can find the all your dfx identities under the ~/.config/dfx/identity directory. The private key .pem files are stored here. (It would be wise to back this up.)

Thanks @Ori This is just what I was looking for and assumed it was somewhere deeper :laughing:

2 Likes

@Ori, i recently had to reboot my machine. Before doing that I saved my dfx identities, but now, after rebooting and installing dfx, I didnt find a way to use the old identity.

Do you (or anyone else) know how to use the other identity?

If you copied the keys from here you should be able to just overwrite them with the ones you had before? Create a default again, go in and change the contents of the keys in that folder.

As @apotheosis says, you can just copy the directories from your backup back to .config/dfx/identity. You can also rename the directories if you want and dfx will use those names in the ‘dfx identity’ command (‘dfx identity list’ will show them all).

You may need to create/deploy a local project on your new machine for the identity directory to show up, or you can just create it manually.

1 Like