0

If I copy aside /bin/echo, and chmod u+s'ing it as root, and then switching back to a weaker user, why can't I run /root/suidecho "something" > /usr/bin/passwd? (Permission denied)

Hauke Laging
  • 88,146
  • 18
  • 125
  • 174
Wosp
  • 1

1 Answers1

2

Simply put, because your elevated echo is with superlative authority writing to standard output, and then your perfectly normal, non-superuser shell is trying to redirect that to a file to which it does not have write privileges.

DopeGhoti
  • 73,792
  • 8
  • 97
  • 133