The home interface

The home interface allows access to non-hidden files owned by the user in the user’s home ($HOME) directory where a user normally stores their personal files and documents.

The majority of snaps use strict confinement and do not have arbitrary access a system’s resources, including file and directories in the /home directory. Without this access, home will not be visible in file requesters, or as a destination from within the snap application.

To check whether a snap can connect to $HOME, use the snap connections command:

$ snap connections <snap-name>
Interface  Plug                Slot         Notes
home       <snap-name>:home    -        -

The above output shows that <snap-name> does provide a home interface (in the Plug column), but that it’s not connected to any slot (denoted by the - in the slot column).

Use the snap connect command to connect an interface:

$ snap connect <snap-name>:home :home

The :home slot, with no <snap-name> before the colon (:) is equivalent to directing the plug to connect to the system, which in this case is the $HOME directory.

A snap developer can request permission to have the home interface connected automatically. In this case, non-hidden files and directories will be accessible from that snap without any further configuration being necessary.

Requires snapd version 2.33+.

Interface documentation:

This is a snap interface. See Interface management and Supported interfaces for further details on how interfaces are used.


Developer details

Auto-Connect:

  • yes on traditional distributions
  • no on all other systems, including Ubuntu Core

Transitional: yes
Attributes:

  • read (plug):
    optional, when set to ‘all’, also allows reading non-hidden files in the home directories of all users as traditional file permissions allow.
    When set to ‘all’ this plug becomes non-autoconnect.

Example snaps

Interface source code

snapd/home.go at master · snapcore/snapd


Last updated 3 months ago.