|
| 1 | +# Installation Example for CentOS 8.0 as an Active Directory Domain Services (AD DS) Member |
| 2 | + |
| 3 | +Install EPEL and PowerTools: |
| 4 | + |
| 5 | +```bash |
| 6 | +$ sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm |
| 7 | +$ sudo dnf config-manager --enable PowerTools |
| 8 | +$ sudo dnf update |
| 9 | +``` |
| 10 | + |
| 11 | +Remove old version of Cockpit if version is less than 201 and install latest Cockpit Preview |
| 12 | + |
| 13 | +```bash |
| 14 | +$ sudo dnf remove cockpit* |
| 15 | +$ sudo dnf config-manager --add-repo https://copr.fedorainfracloud.org/coprs/g/cockpit/cockpit-preview/repo/rhelbeta-8/group_cockpit-cockpit-preview-rhelbeta-8.repo |
| 16 | + |
| 17 | +$ sudo dnf install cockpit cockpit-storaged setroubleshoot-server |
| 18 | +``` |
| 19 | + |
| 20 | +Enable Cockpit: |
| 21 | + |
| 22 | +```bash |
| 23 | +$ sudo systemctl enable --now cockpit.socket |
| 24 | +``` |
| 25 | + |
| 26 | +Create firewall rules for Cockpit: |
| 27 | + |
| 28 | +```bash |
| 29 | +$ sudo firewall-cmd --permanent --zone=public --add-service=cockpit |
| 30 | +$ sudo firewall-cmd --reload |
| 31 | +``` |
| 32 | + |
| 33 | +Install ZFS as per own requirements from ZFS on Linux: [https://github.com/zfsonlinux/zfs/wiki/Custom-Packages](https://github.com/zfsonlinux/zfs/wiki/Custom-Packages) |
| 34 | + |
| 35 | +Install Samba |
| 36 | + |
| 37 | +```bash |
| 38 | +$ sudo dnf install -y realmd oddjob-mkhomedir oddjob samba-winbind-clients samba-winbind samba-common-tools |
| 39 | +$ sudo dnf install -y samba |
| 40 | +$ sudo dnf install -y samba-winbind-krb5-locator krb5-workstation samba-client |
| 41 | + |
| 42 | +$ sudo rm /etc/samba/smb.conf |
| 43 | +``` |
| 44 | + |
| 45 | +Join AD DS: |
| 46 | + |
| 47 | +```bash |
| 48 | +$ sudo realm join --client-software=winbind domain.example.com -U Administrator |
| 49 | +``` |
| 50 | + |
| 51 | +Start Samba |
| 52 | + |
| 53 | +```bash |
| 54 | +$ sudo systemctl start smb |
| 55 | +``` |
| 56 | + |
| 57 | +Verify information is retrieved from AD DS: |
| 58 | + |
| 59 | +``` |
| 60 | +$ sudo getent passwd "DOMAIN\Administrator" |
| 61 | +$ sudo getent group "DOMAIN\Domain Users" |
| 62 | +$ sudo wbinfo -g |
| 63 | +$ sudo wbinfo -u |
| 64 | +``` |
| 65 | + |
| 66 | +Edit Samba configuration file and set the AD DS schema mode, ACLs and Previous Versions properties: |
| 67 | + |
| 68 | +```bash |
| 69 | +$ sudo nano /etc/samba/smb.conf |
| 70 | +``` |
| 71 | + |
| 72 | +Append to [global] section |
| 73 | + |
| 74 | +``` |
| 75 | +[global] |
| 76 | +~ |
| 77 | +idmap config DOMAIN : schema_mode = rfc2307 |
| 78 | +
|
| 79 | +vfs objects = acl_xattr shadow_copy2 |
| 80 | +store dos attributes = yes |
| 81 | +map acl inherit = yes |
| 82 | +inherit acls = yes |
| 83 | +inherit permissions = yes |
| 84 | + |
| 85 | +shadow: snapdir = .zfs/snapshot |
| 86 | +shadow: sort = desc |
| 87 | +shadow: format = %Y.%m.%d-%H.%M.%S |
| 88 | +shadow: localtime = yes |
| 89 | +
|
| 90 | +admin users = @"DOMAIN\Domain Admins" |
| 91 | +``` |
| 92 | + |
| 93 | +Reload Samba configuration: |
| 94 | + |
| 95 | +```bash |
| 96 | +$ sudo smbcontrol all reload-config |
| 97 | +``` |
| 98 | + |
| 99 | +Grant Disk Operator Privileges: |
| 100 | + |
| 101 | +```bash |
| 102 | +$ sudo net rpc rights grant "DOMAIN\Domain Admins" SeDiskOperatorPrivilege -U "DOMAIN\Administrator" |
| 103 | +``` |
| 104 | +Enable SELinux booleans: |
| 105 | + |
| 106 | +```bash |
| 107 | +$ sudo setsebool -P samba_export_all_ro=1 samba_export_all_rw=1 |
| 108 | +$ sudo getsebool -a | grep samba_export |
| 109 | +``` |
| 110 | +Create firewall rules for Samba: |
| 111 | + |
| 112 | +```bash |
| 113 | +$ sudo firewall-cmd --permanent --add-service=samba |
| 114 | +$ sudo firewall-cmd --reload |
| 115 | +``` |
| 116 | + |
| 117 | +Restart and Enable Samba service: |
| 118 | +```bash |
| 119 | +$ sudo systemctl restart smb |
| 120 | +$ sudo systemctl enable smb |
| 121 | +``` |
| 122 | + |
| 123 | +#### Red Hat Enterprise Linux 8 Documentation |
| 124 | + * [Chapter 2. Using Samba as a Server](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/deploying_different_types_of_servers/assembly_using-samba-as-a-server_deploying-different-types-of-servers) |
0 commit comments