How can I overcome this problem?
Devices:
Samsung Galaxy TabS - Android 4.4.2
HTC M8 - Android 5.0.1
The two devices have the same problem.
Your device is not rooted. To see what Rooting is and how to go about doing it:
Once you have rooted your device, you will be able to access the Super User state of your device (SU). Just be aware that rooting could brick your device if done incorrectly, as could tampering with files in the root directory.
This also happened to me.
I use Infinity X (the GApps Variant) and have it rooted with KernelSU.
When running adb shell and su, I have the same error.
The solution is very simple:
KernelSU,Super user tab,Shell (the one with com.android.shell),
subinary doesn't come with factory shipped devices. You need to root the device (which involves finding and pushing thesubinary into/system/bin/or/system/xbin/). See What is rooting?suand in order to accesssuit has to be present first. How would you move the binary depends upon the device you're using. Some methods are mentioned here: How do I root my Android device?