Linux Sucks

Pages: 1234... 6
Overall, your dislike is totally valid.

Although you did enable dangerous functionality twice: first when you typed in sudo and again when you passed -R to the tool. It's not like you made a normal typo as a regular user and nuked the computer; you accepted the danger more than once.

Every once and a while you will come across a tool that asks for confirmation. For example hdparm makes the user type --yes-i-know-what-i-am-doing --please-destroy-my-drive on occasion:
https://github.com/Distrotech/hdparm/blob/4517550db29a91420fb2b020349523b1b4512df2/hdparm.c#L890-L908

While hilarious, if you're running hdparm at all you should probably double check all your commands.
And it's normal to blame the tools, but learning to use the tools is part of using them.

Sometimes, the tools are to blame.

For example, on codingame.com - there was an error in which one of the bots I coded would be doomed to lose. I tried everything to debug it, but in the end I concluded it must be something wrong with how its setup on the on the website.

Lo and behold, couple weeks later, I run the code that was "broken" and it works like a charm. When I told others on the site the issue, they all made fun of me for blaming the website - but it there was simply no other explanation - the evidence was clear.

I understand 100% that usually when a person blames their compiler or their tools when those aren't the issue. However, this creates a bias in that people start seeing issues as coming from only people and not the software - forgetting people created the software. They CAN BE the issue whether it be broken code or poor design.


Own the mistake and learn from it

This isn't the kind of mistake you own up to and learn from. There's nothing to learn. There's no knowledge you can gain that can stop you from making a typo. That's like playing a video game, missing a head shot, and thinking somehow you can learn from that to be 100% accurate next time.


Although you did enable dangerous functionality twice: first when you typed in sudo and again when you passed -R to the tool. It's not like you made a normal typo as a regular user and nuked the computer; you accepted the danger more than once.

I was actually copying it off a website.

Yea, I made the typo - my mistake. But when people point the finger at me instead of the OS, it makes me wonder.. What if I coded a program that would destroy your computer if you made a typo? Would you call the person who made the typo an idiot or say I should make my program be able to handle typos?
What if I coded a program that would destroy your computer if you made a typo?

But there are plenty of programs that already do that, chmod, dd, hdparm, rm, passwd, parted and so on.

Neither you (the user) nor the author (of chmod) is an idiot, it's just a mistake.
Last edited on
But there are plenty of programs that already do that... Neither you nor the author is an idiot, it's just a mistake.

That's my point. If someone came here with a program and we saw that a simple typo by the user could potentially destroy the OS, we wouldn't just say nothing. We wouldn't say, "oh well, let the users figure it out and be careful." We'd tell the person the program has a major flaw.

But when it comes to Linux, everyone gives it an exception. They say, "Well, you should just know, be careful". It doesn't make sense - especially when they make this claim that even newbies can use Linux as their main OS.
As ne555 mentioned much earlier, it is not clear why perms of 775 have made the machine unusable, in particular why you claim sudo does not work. Obviously, the perms are now too permissive. Btw, that was an insolent reply you made to ne555, I think he deserves more respect than that.

It is also not clear why you had to resort to using chmod anyway, package managers are careful to install correctly. It sounds like your procedure is winging it: perms of 775 is a straight up red flag; a sledgehammer for the peanut, only 1 step away from 777 perms.

I have Fedora SilverBlue as my Linux: the OS files are immutable. Maybe you should consider installing that.

How much does a Raspberry Pi cost? Start again and learn from it. Keep it in your man bag, not 1000 miles away.

Anyway, this topic could just be yet another traffic generator, may even have been a response to the posts I made about it recently. Some of the hallmarks: OS flame war; misdirection; deflection; insolence; argumentative to those who have superior knowledge and or experience; a contrived situation to whinge about.

It may even be telling that you admit to having experience writing bots. While there are plenty of valid reasons to have a bot, this could be another piece of empirical evidence to make the possible more probable.
zapshe’s not a bot, tho
As ne555 mentioned much earlier, it is not clear why perms of 775 have made the machine unusable

Who knows, but ever since that command I can't run anything with root privileges. The specific error it gives me.

It is also not clear why you had to resort to using chmod anyway

It was for my PHP file, not a package.

Keep it in your man bag, not 1000 miles away.

Its over there for a reason, its where I can host the website.

It may even be telling that you admit to having experience writing bots

Bots that play games. Bots that can talk would be pretty hard.
1) So your response to what you believe is atrocious is to… do the exact same thing without making your tone evident. That's genuinely funny to me.
2) It's also funny that you jumped the gun a little bit with the "I don't have to use the terminal because I can do file transfers", given that you respond to the rest of my comment further down.
3) You expressed annoyance with having to use the terminal, in particular because of perceived safety problems. I proposed ways for you to limit your use of it. Though, if you just want a safety net, many flavors exist. See earlier suggestions.
4) I actually have a pretty good idea of what's involved to set up that kind of stuff on common distros, and no, the process shouldn't involve any commands that would lead to catastrophe if typoed as you did above. Either way, you're missing the point. See the above point.
5) Finally we get to a more rounded statement from you, ignoring the sarcastic bit. I appreciate that, I really do. That said, I'm getting the impression that you're writing your reply to my post as you're reading it, because that's the second (and later, third) time you've said something I addressed later in my post.
6) Believe it or not, I would defend Windows if an application broke in the way you described. I personally dislike the operating system, but when an application breaks, the operating system is (barring certain special circumstances, which this does not appear to be) one of the last things to consider as the source of the bug.
7) Your professor is irrelevant in this discussion. Continuing to focus on the formatting of these posts — which you seem perfectly capable of reading — suggests that you made the point just to have something extra to attack. Hence, pettiness.
8) I can't help but think you're deliberately being obtuse wrt. what citation was expected from you. I wasn't doubting that chmod +R ??? / will break your system (it absolutely will). Nor have I expressed doubt that you ran that command (though I'm still fascinated that you managed to make the typo you described above).
9) There are legitimate criticisms to be leveled against components of the GNU/Linux ecosystem. But as I have said, you appear to be assigning blame prematurely. So, for a relevant definition of "certain errors", actually I do have reason to say it's a mistake.
10) Ranting and being both fair and constructive in your feedback are not mutually exclusive by any stretch of the imagination. I was hoping you'd hold yourself to that standard. All well.
11) Not that you managed to establish that my points were flat out wrong, but either way I could have been nicer. That's true. Mind you, I find it somewhat difficult to be sympathetic here, given your argumentation history and that this rant had been you asserting that a tool sucks, prompted by you making a careless mistake with that tool.

Finally, I'd like to respond to this bit separately:
zapshe wrote:
This isn't the kind of mistake you own up to and learn from. There's nothing to learn. There's no knowledge you can gain that can stop you from making a typo


Except… there is plenty to learn here, including but not limited to how to avoid such typos causing problems in the future (whether with chmod specifically or with any command run via sudo). There's a lot that can be read into your non-acknowledgement of them, but I'll avoid conjecture in this case, at this time.

-Albatross

P.S. - Some people seem unsure about why the command would lead to problems beyond simply throwing the installation's security in the trash. The main reason why is that chmod 775 may clear the setuid, setgid, and sticky bits on files. In particular, sudo relies on being owned by root and having the setuid bit set on it; without it, it doesn't have the permissions necessary to run correctly.
Eh, you haven't lived until you have screwed up like this a few times, whether its deleting your source code or wiping out your OS or even more exciting, breaking something at your job very badly.
Within a week of my first home PC I was sitting there reinstalling DOS because of a typo like this -- I had just gotten it about right and oops. Ive had my share of disasters since then, too -- I took down the main campus server with a shell script that filled their disk with log messages in no time flat.

Some of this is like the C++/C mentality, though. A lot of gimpy languages (java specifically) tout how awesome they are because they took away all that dangerous stuff. This is the microsoft mentality. C/C++ is proud to have full access to do what you want to do the way you want to do it -- that is the unix approach. Yes, you can shoot yourself in the foot on unix or in powerful languages. I dislike unix myself, for a mix of reasons... when I was younger it was difficult to work with, required you to compile it frequently, and often would not work right after that, and the tools for coding were 3+ generations behind windows (after about 1995 that is). Its not the mentality, its just that it was not much good when I needed it and now, I don't need it.
Last edited on
C/C++ is proud to have full access to do what you want to do the way you want to do it

And I really like that because its a programming language - I want to be able to do anything with it! But I can't use an operating system that's that fragile ;(

So your response to what you believe is atrocious is to… do the exact same thing without making your tone evident. That's genuinely funny to me.

Hard to convey tone through text. I know what I meant, doesn't matter too much to me if you don't.

It's also funny that you jumped the gun a little bit

I reply as I read. Faster that way, kinda busy.



It doesn't matter if there are safer flavors or ways to mitigate it. I'm not a regular user and don't want to deal with that. There's no reason I should have to go through a hassle because the OS can't issue a prompt like, "Are you sure you want to do this?"


Again - before you reply to that statement, I want you to think: If zapshe made a program that could break an OS if the user makes a typo then said, "Well, if you just download this other thing it'll stop my program from breaking the OS." Would you think, "That's a great idea!" or "WTF? FIX YOUR PROGRAM DUMMY!"



Honestly, I can't go through the rest of what you said. It's impossible to read. Not trying to be rude, I really just look at that wall of text and I can't even bring myself to start reading anymore.

@zapshe
Here is some other things, only really mentioning them because it may help others:

Have separate virtual machines for dev, testing, and live. It's asking for trouble doing all 3 on one actual machine, a firable offense where I worked some years back. This is easy to do on Linux, gnome has the Boxes gui program, and there is qemu et al. Virtual machines have snapshots that can be reverted to.

sudo can be configured as to what it can and can't do, so RTM that.

Also, I would hate to see you doing some shell scripting, imagine what a tangle that could potentially be, given the problems so far.

@Albatross

I would have thought one needs to use 4 digit perms to fiddle with the setuid, setgid, and sticky bits. But you know much more than me, I am certain :+)
Have separate virtual machines for dev, testing, and live.

Not a bad idea - I might do that when I go to debug that PHP bug to see if it exists there too.
C/C++ is proud to have full access to do what you want to do the way you want to do it

I've always liked Thomas Becker's phrasing in: http://thbecker.net/articles/rvalue_references/section_04.html
As we all know, the First Amendment to the C++ Standard states: "The committee shall make no rule that prevents C++ programmers from shooting themselves in the foot."

Spiderman has some mantra too.


A Linux distro with package management surely has a "reinstall package" functionality. On EL I can trivially list files that have changed attributes compared to what was installed from package and reinstall the package, if needed. Not to mention separate rescue kernel that has self-sufficient initramfs for booting system and poking filesystem content when the main system is unbootable.

On system you have OS files, configuration, and user data. OS files should be trivial to (re)install from packages and you can blame only yourself, if you don't have copy of configs and data to redeploy/restore from.

Installing a system, all necessary applications, and desired config takes minutes if you are prepared for it.
That combined with VMs is deliciously expendable.


I was actually copying it off a website.

Copying from web contains dangers. It is one attack vector for malicious users, and you surely know that you can't trust anyone on the INET for factual content ... except us. ;)
Last edited on
Just a quick one...I usually set sudo to require a password every time it's used...it gives me a bit of breathing space on a excreter/extractor interface situation.
Copying from web contains dangers. It is one attack vector for malicious users

That's not a worry if you know what you're doing. The website and command was safe, I just accidently hit enter.

Just a quick one...I usually set sudo to require a password every time it's used

Well, that would a solution - though an annoying one. I already have to put in a password to SSH into the pi, then to get into mySQL, and then half I'm using require sudo to run :(
That's not a worry if you know what you're doing. The website and command was safe, I just accidently hit enter.
I know that this will kill me, so it is safe. Nothing to worry about. :rolleyes:
I know that this will kill me, so it is safe. Nothing to worry about. :rolleyes:

Also, make sure to scan everything before you download it, it might have a virus. Steam games? Why trust them, scan all 50GB of Batman Arkham Knight, you don't know.

Before you open a website make sure to do a full investigation, would be a shame to fall into a virus ridden website.

Never rely on your experience or knowledge, you're too fallible as a human being.
> In particular, sudo relies on being owned by root and having the setuid bit
> set on it; without it, it doesn't have the permissions necessary to run
> correctly.
so that was it
sudo wrote:
/usr/bin/sudo must be owned by uid 0 and have the setuid bit set

edit: ¿so a simple # chmod a+s /usr/bin/sudo would solve the issue? (too bad they probably can't login as root over ssh)

> I would have thought one needs to use 4 digit perms to fiddle with the
> setuid, setgid, and sticky bits.
man chmod wrote:
Omitted digits are assumed to be leading zeros.
I prefer symbolic mode chmod u+x,g+wx,o+x


> There's no knowledge you can gain that can stop you from making a typo.
in no particular order:
- edit sudoers file so sudo always ask you for a password
- use --reset-timestamp flag so sudo always ask you for a password (may alias it)
- use --preserve-root, --interactive, --dry-run or similar flags for «destructive» commands
- limit the damage, use symbolic mode and add only what you need `g+w'
- limit the damage, you could have `cd /var/www/html/' and then `chmod -R ??? .'
Last edited on
Again, I'll bring up this point:


I make a program that if you make a typo on can destroy your OS. Do you:

A. Tell the user to set flags and run commands to stop this from being an issue.

B. Tell me to get my shit together and make the program safer.

There's no difference. No one is saying to take away power from users, but a little warning would hardly be a crazy idea. The more you debate me on it, the more you argue for user conformity rather than good programming practices.



I mean, hell, it asks if you're sure you want to DOWNLOAD a package! God forbid they ask you if you're sure you want to run an OS destroying command.
Last edited on
Stop complaining. Linux has protections and you overrode them with sudo.

If you're think you're fragile and can't be trusted with sudo, then configure it to help you as @albatross suggested. But really, how many times are you going to repeat this stuff?


Pages: 1234... 6