Back to article
Fixing sudo Permission Denied Errors
Curing sudo 'Permission denied' Errors
July 7, 2010
If you're using Sudo, you've probably already discovered that the increased privileges apply only to the first command typed and don't extend to any input or output redirection. For example:
sudo iptables -L > /etc/iptableswill give you a 'Permission denied' error because the shell interprets the first command (with sudo), then pipes it into the second command (without sudo).
One solution to this is to jump straight into the root user shell with su. However, this ignores all the many very good reasons to use sudo in the first place (including...
Read the rest of this sudo tip at Serverwatch.com