Skip to content

Commit deaf0eb

Browse files
committed
Add feedback
1 parent 6f69d32 commit deaf0eb

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

articles/iot-edge/how-to-manage-device-certificates.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ If your PKI provider provides a `.cer` file, it may contain the same certificate
6464
* If it's in DER (binary) format, convert it to PEM with `openssl x509 -in cert.cer -out cert.pem`.
6565
* Use the PEM file as the trust bundle. For more information about the trust bundle, see the next section.
6666
67-
## File and directory permissions requirements
67+
## Permission requirements
6868
6969
The following table lists the file and directory permissions required for the IoT Edge certificates. The preferred directory for the certificates is `/var/aziot/certs/` and `/var/aziot/secrets/` for keys.
7070
@@ -75,6 +75,29 @@ The following table lists the file and directory permissions required for the Io
7575
| `/var/aziot/secrets/` keys directory | drwx------ (700)| aziotks |
7676
| Key files in `/var/aziot/secrets/` | -wr------- (600) | aziotks |
7777
78+
To create the directories, set the permissions, and set the owner, run the following commands:
79+
80+
```bash
81+
# If the certificate and keys directories don't exist, create, set ownership, and set permissions
82+
sudo mkdir -p /var/aziot/certs
83+
sudo chown aziotcs:aziotcs /var/aziot/certs
84+
sudo chmod 755 /var/aziot/certs
85+
86+
sudo mkdir -p /var/aziot/secrets
87+
sudo chown aziotks:aziotks /var/aziot/secrets
88+
sudo chmod 700 /var/aziot/secrets
89+
90+
# Give aziotcs ownership to certificates
91+
# Read and write for aziotcs, read-only for others
92+
sudo chown -R aziotcs:aziotcs /var/aziot/certs
93+
sudo chmod 644 /var/aziot/certs/*
94+
95+
# Give aziotks ownership to private keys
96+
# Read and write for aziotks, no permission for others
97+
sudo chown -R aziotks:aziotks /var/aziot/secrets
98+
sudo chmod 600 /var/aziot/secrets/*
99+
```
100+
78101
## Manage trusted root CA (trust bundle)
79102

80103
Using a self-signed certificate authority (CA) certificate as a root of trust with IoT Edge and modules is known as *trust bundle*. The trust bundle is available for IoT Edge and modules to communicate with servers. To configure the trust bundle, specify its file path in the IoT Edge configuration file.
@@ -86,7 +109,7 @@ Using a self-signed certificate authority (CA) certificate as a root of trust wi
86109
1. Copy the PEM file and give IoT Edge's certificate service access. For example, with `/var/aziot/certs` directory:
87110

88111
```bash
89-
# Make the directory as root if doesn't exist
112+
# Make the directory if doesn't exist
90113
sudo mkdir /var/aziot/certs -p
91114

92115
# Change cert directory user and group ownership to aziotcs and set permissions
@@ -171,7 +194,7 @@ IoT Edge can use existing certificate and private key files to authenticate or a
171194
sudo chmod 644 /var/aziot/certs/my-cert.pem
172195

173196
# Give aziotks ownership to private key
174-
# Read and write for aziotks, no permission for other
197+
# Read and write for aziotks, no permission for others
175198
sudo chown aziotks:aziotks /var/aziot/secrets/my-private-key.pem
176199
sudo chmod 600 /var/aziot/secrets/my-private-key.pem
177200
```

0 commit comments

Comments
 (0)