Linux - Sudo defaults env_keep always_set_home, Script store output as same user not as root

Sudo defaults env_keep always_set_home

# grep 'Defaults env_keep += "HOME"' /etc/sudoers

Defaults env_keep += "HOME"

Add the below lines in /etc/sudoers
Defaults always_set_home
Defaults:username !requiretty,!always_set_home

Script to modify sudoers file:
# sed -i 's/Defaults:username !requiretty/Defaults: username
!requiretty,!always_set_home/' /etc/sudoers

The topic on Linux - Sudo defaults env_keep always_set_home is posted by - Math

Hope you have enjoyed, Linux - Sudo defaults env_keep always_set_homeThanks for your time

Tech Bluff