Identify user in a Bash script called by sudo

前端 未结 7 1973
闹比i
闹比i 2020-12-07 14:39

If I create the script /root/bin/whoami.sh containing:

#!/bin/bash
whoami

and this script is called by a user with a properly

相关标签:
7条回答
  • 2020-12-07 15:13

    Odd, the system does distinguish between real and effective UIDs, but I can find no program that exports this at shell level.

    0 讨论(0)
提交回复
热议问题