Security

Use these commands when you manage security related tasks. Routes displays all routes of ownCloud. You can use this information to grant strict access via firewalls, proxies or load balancers etc.

Command Description

security:routes [options]

Options

--output=[OUTPUT]

Output format (plain, json or json-pretty, default is plain).

--with-details

Adds more details to the output.

Example 1:

sudo -u www-data php occ security:routes
+-----------------------------------------------------------+-----------------+
| Path                                                      | Methods         |
+-----------------------------------------------------------+-----------------+
| /apps/federation/auto-add-servers                         | POST            |
| /apps/federation/trusted-servers                          | POST            |
| /apps/federation/trusted-servers/<id>                     | DELETE          |
| /apps/files/                                              | GET             |
| /apps/files/ajax/download.php                             |                 |
...

Example 2:

sudo -u www-data php occ security:routes --output=json-pretty
[
  {
      "path": "\/apps\/federation\/auto-add-servers",
      "methods": [
          "POST"
      ]
  },

Example 3:

sudo -u www-data php occ security:routes --with-details
+---------------------------------------------+---------+-------------------------------------------------------+--------------------------------+
| Path                                        | Methods | Controller                                            | Annotations                    |
+---------------------------------------------+---------+-------------------------------------------------------+--------------------------------+
| /apps/files/api/v1/sorting                  | POST    | OCA\Files\Controller\ApiController::updateFileSorting | NoAdminRequired                |
| /apps/files/api/v1/thumbnail/{x}/{y}/{file} | GET     | OCA\Files\Controller\ApiController::getThumbnail      | NoAdminRequired,NoCSRFRequired |
...

The following commands manage server-wide SSL certificates. These are useful when you create federation shares with other ownCloud servers that use self-signed certificates.

security:certificates         List trusted certificates
security:certificates:import  Import trusted certificate
security:certificates:remove  Remove trusted certificate

This example lists your installed certificates:

sudo -u www-data php occ security:certificates

Import a new certificate:

sudo -u www-data php occ security:certificates:import /path/to/certificate

Remove a certificate:

sudo -u www-data php occ security:certificates:remove [certificate name]