Setting Up SMB on Jamf Pro Using Red Hat Enterprise Linux

Technical Articles

Solution
Application
Content Type
Technical Documentation
Utilities & Services
ft:locale
en-US
  1. Confirm the version of Red Hat Enterprise Linux you are using by executing the following command:
    $ cat /etc/redhat-release
  2. Install net-tools to allow for basic network operations by executing the following command:
    $ sudo yum -y install net-tools
  3. Install the Samba service by executing the following command:
    $ sudo yum -y install samba*
  4. Add users for the service and set passwords. You will need two accounts: one with read-only permissions and another with full permissions to the file share.
    1. Create the read-only account, jamfR by executing the following command:
      $ sudo useradd -d /home/jamfR jamfR -s /bin/false -N
    2. Set the password by executing the following command:
      $ sudo smbpasswd -a jamfR
    3. Create the full-access account, jamfRW by executing the following command:
      $ sudo useradd -d /home/jamfRW jamfRW -s /bin/false -N
    4. Set the password by executing the following command:
      $ sudo smbpasswd -a jamfRW
  5. Create a location for the file share by executing the following command:
    $ sudo mkdir -p /usr/local/jamf/jamfShare
  6. Set the owner of the account that has full access to the file share by executing the following command:
    $ sudo chown jamfRW /usr/local/jamf/jamfShare
  7. Set permissions on the file share by executing the following command:
    $ sudo chmod 755 /usr/local/jamf/jamfShare
  8. Edit the Samba configuration file by executing the following command:
    $ sudo vi /etc/samba/smb.conf
  9. Add the following code block directly above the line that starts with [global]:
    [jamfShare]
        comment = jamfShare
        path = /usr/local/jamf/jamfShare
        browsable = yes
        guest ok = no
        read only = yes
        create mask = 0755
        read list = jamfR
        write list = jamfRW
        valid users = jamfR, jamfRW
  10. Configure the firewall to allow Samba traffic by executing the following command:
    $ sudo firewall-cmd --add-service=samba --permanent
  11. Reload the firewall to activate the new rule by executing the following command:
    $ sudo firewall-cmd --reload
  12. To manage SELinux configuration, install semanage by executing one of the following commands:
    • Red Hat Enterprise Linux 9 or Red Hat Enterprise Linux 8:

      $ sudo yum install policycoreutils-python-utils
    • Red Hat Enterprise Linux 7:

      $ sudo yum -y install policycoreutils-python
  13. Set the SELinux configuration to allow Samba read/write permissions by executing the following commands:
    $ sudo setsebool -P smbd_anon_write=1
    $ sudo semanage fcontext -a -t public_content_rw_t "/usr/local/jamf(/.*)?"
    $ sudo restorecon -Rv /usr/local/jamf
  14. Start the Samba service by executing the following command:
    $ sudo systemctl start smb
  15. Enable the service at startup by executing the following command:
    $ sudo systemctl enable smb
  16. Using Terminal on a Mac, ensure you have a successful connection to the file share (use port 139 and/or 445) by executing the following command:
    $ nc -v fqdn.of.server 139
  17. Add the file share to your Jamf Pro server:
    1. In Jamf Pro, click Settings in the top-right corner of the page.
    2. Click Server Infrastructure, and then click File Share Distribution Points.
    3. Click New.
    4. Enter a Display Name for the file share and the fully qualified domain name of the server:
    5. Click the File Sharing tab and enter the Share Name that was defined in the Samba configuration file. Leave the Workgroup Or Domain field blank and the Port set to 139:
      File Sharing Tab
    6. Enter the credentials for the two Samba accounts that you created earlier:
      File Sharing Read/Write Account and Read-Only Account
    7. Click Save.