DEV Community

Discussion on: 9 Evil Bash Commands Explained

Collapse
 
devmount profile image
Andreas

Well, yes you can see it this way 😅 but this post was completely meant for self protection not for making it easy for attackers... So I hope there are no BOFHs here... 🙊

Collapse
 
metalmikester profile image
Michel Renaud

A few of these scared me most in how easy it would be to make that mistake.

Thread Thread
 
devmount profile image
Andreas

Yes same here. That was one of the reasons to write this post. However I read that some of these depend on the Linux distribution, but I wouldn't count on that. I was really surprised to see, that chmod and chown both have a --preserve-root and --no-preserve-root flag to prevent misuse, but the default argument is --no-preserve-root! So if you run a command without a "preserve" option, it will default to "no preserve" mode and hence change permissions on a lot of files that shouldn't be changed.