Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
wrycoder
· 9y ago · 0 comments
Hm. How about ‘sudo’ <> ? i.e. quote the command?
Comments
[–]
wallacoloo
9y ago
If they have access to your .bashrc they can also alter your PATH and create a script named
sudo
somewhere they have write access to that carries the malicious payload. So you're not gaining
much
by adding the quotes.
[–]
chrisfosterelli
9y ago
Based on the sibling comment to yours, I don't think bash supports this. zsh allows you to make a \'sudo\' alias though, so it depends on your shell.
[–]
wrycoder
OP
9y ago
At least in bash, quoting the command disables any alias. Maybe also in zsh?
[–]
chrisfosterelli
9y ago
zsh seems to have much more flexible alias rules than bash:
> alias \'sudo\'='ls -a' > 'sudo' . ..