Creating SMB Shares

You can build and manage Windows Server Message Block (SMB) v3 (Samba) shares in an Oracle Cloud Infrastructure (OCI) instance, and export files to the compute instance.

Prerequisites and Considerations

Before you begin:

Creating a Samba Share In an OCI Instance

To create a Samba share in an OCI instance from the command line:

  1. Follow the instructions in Managing Samba, and specify the following:
    • For the samba_server value, enter the IP address or host name of the OCI instance.
    • In the File Settings section of the Samba configuration file, enter the path and name of the share on the OCI instance.
  2. Access the Samba share. See Accessing NFS and Samba Shares.

Creating a Samba Share In an OCI Instance Using Cockpit

You can create a Samba share in a compute instance from the Cockpit web console by using the Cockpit file sharing plugin.

To create a Samba share using the Cockpit web console:

  1. Review the information in Managing Samba.
  2. Install and configure Samba on the OCI instance.

    For example:

    sudo dnf install samba samba-common samba-client -y
  3. Allow Cockpit to configure Samba by editing the /etc/samba/smb.conf Samba configuration file, and adding include = registry in the global section of the file.

    For example:
    ....
    workgroup = SAMBA
    security = user
    passdb backend = tdbsam
    printing = cups
    printcap name = cups
    load printers = yes
    cups option = raw
    include = registry
    ....

    Adding the registry value to the Samba configuration file lets you view the Samba tab in the Cockpit web console.

  4. On the instance, install and enable Cockpit. See Install and Enable Cockpit.
  5. Use DNF to install the cockpit-file-sharing package.

    The package is located in the DNF developer_EPEL repository, and you must enable the repository before installing the cockpit-file-sharing package.

    For example:

    sudo yum-config-manager --enable ol9_developer_EPEL
    sudo dnf install cockpit-file-sharing
    Note

    Packages found in the developer_EPEL repositories are considered unsupported and are only entitled to basic installation support. Content from this repository isn't recommended for production environments and is intended for developer purposes only.
  6. Log in to Cockpit. See Log in to the Cockpit Web Console.

  7. Create a new Samba share:
    1. Click File Sharing, and then click the Samba tab.
    2. In the Share Management section of the page, click the blue plus sign (+) button.

      The Add New Share window is displayed.

    3. Enter the name of the Samba share, and the path to the share on the compute instance.

    4. Optionally select the Oracle Linux users and groups, and specify the type of file access you want to grant them.

      Samba uses existing Oracle Linux users, but you can set different passwords for file access through the Cockpit web console.

    5. Click Add Share.

  8. Access the Samba share. See Accessing NFS and Samba Shares.