Adding support to sudo to open a file with elevated privileges
Piotr Dobrogost <[email protected]> Sat, 4 Sep 2021 13:50:54 +0200
| Newsgroups | gmane.comp.tools.sudo.user |
|---|---|
| Message-ID | <CAA6tFMtxRnJO=uSMYd_5JqW-ejxnHzfMSsG6YSQbe6U3YQ+-fw@mail.gmail.com> |
Hi! People often run into a problem trying to redirect output of a command being run with sudo to a file which is writable by the target user but is not writable by the user running sudo: sudo echo "something" > /etc/some_file The suggested workaround – https://superuser.com/q/136646/664 (How to append to a file as sudo?) – is to use tee: echo "something" | sudo tee /etc/config_file > /dev/null Would it make sense to add support to sudo for opening a file with elevated privileges? This would avoid having to use an external program for this basic functionality and would avoid having to redirect standard output to /dev/null which is the case when using tee? Something along the lines of echo "something" | sudo --out /etc/config_file Best regards, Piotr Dobrogost ____________________________________________________________ sudo-users mailing list <[email protected]> For list information, options, or to unsubscribe, visit: https://www.sudo.ws/mailman/listinfo/sudo-users