Activate developer mode by tapping 5 times on the Build number in Settings -> Device Information
Activate Oem Unlock
Download the Root Magisk file in the link below
Copy Magisk Root and put it into internal memory
Download TWRP for Galaxy S8 or S8 +
Proceed to Download Mode by turning it off and then holding down the 3 keys. Source + Home + Vol (-) -> Select Continues.
Open Odin to select AP and path to twrp ... .tar file
Click Start to start the flash.
Bring your phone to recovery mode by turning it off and holding down the 3 power keys. Power + Home + Vol (+)
In TWRP you choose Install, select the Magisk file to install
The installation process is over, select reboot system to reboot.
Magisk file http://www.mediafire.com/file/utd3zfp4koy54bb/Magisk_Root_Android_Nougat_Datdevs.zip
TWRP for SM-G950F SM-G950FD SM-G950L SM-G950N = http://www.mediafire.com/file/l8uh2qv6w73o49z/twrp-3.1.0-1-dreamlte.img.tar
TWRP for SM-G955F SM-G955FD SM-G955L SM-G955N = http://www.mediafire.com/file/b5yga4w01ojk2zs/twrp-3.1.0-1-dream2lte.img.tar