November
18
Linux: Run a command as a different user with root access without a password
Add user to sudoers
echo “user2 ALL=NOPASSWD: ALL” | tee -a /etc/sudoers.d/user2
Run Command
/bin/su -c ‘sudo nohup /df -h &’ user2