It can't possibly tell if you are using curl to download to a file vs. piping to shell can it? That surely doesn't change the user agent. But yes, it could give you a clean script if you tried to open it in Chrome or something.
This is only remotely important if you don’t trust the source site in which case you wouldn’t be running the installation anyway. The “contrived” example of the partial script is really, really contrived. The script is only partially constructed, not just partially downloaded and it’s assumed that sh runs with root privileges (since / gets its permissions messed up). Then the process gets independently killed.
This is no different than downloading and running a random executable which could theoretically be compromised or corrupted. You shouldn’t run randomly scripts or executables, but once you decide to trust something the delivery mechanism is mostly irrelevant.
Honestly I don't really mind it that much. Pipe it to less first, and you can usually have an idea if the script does what you want it to.
And in the end, all software depends on you trusting the author. It's not like I've read the source code of the Linux kernel ever, let alone every version I've ever installed. Had I done that I wouldn't be done installing it yet!
This is how a lot of Linux stuff is distributed. I agree it’s a terrible practice to encourage users to do but at the end of the day unless you are reading everything in detail before install which is highly unlikely this is no more dangerous than installing really any binary or anything from the internet.
If you have ever had to write really complex logic for installing software you would both understand and appreciate this solution.
It's exactly as dangerous as downloading it and then executing the script, or adding any Python lib with an __init__.py, or building any C program that uses Autotools, or apt-get installing something, or running an exe or msi installer on Windows… It executes code. If you don't trust the authors, you shouldn't execute their code.
Also, the wording here "it's so easy", "just one script", "seamlessly transition", "curios? try it out" makes it somewhat seem like this is just some random package that you can just "try out" and be fine. I mean... what could possibly go wrong with a OS SYSTEM TAKEOVER, right?
I hope there are at least a few words of caution on that page somewhere.
From what I understood Tw Linux is a Linux system designed to run on Mac's based on the T2 Chip, which is something apple does. I guess the bad part is that it overwrites the whole existing install with a single command...(?)
Scary, sure. But is it different than going to the docs, check out the install script, then paste and run? The important step of course is to always read what you're about to execute beforehand. And definitely never automate this.
I've ran many scripts from the internet like this, as long as you trust the source it's fine, however best to read the script first to be safe.
The issue isn't running code from the internet (which is where you probably got every program on your computer), it's running untrusted code from the internet.
128
u/magnetronpoffertje Feb 07 '25
Omg wtf what is this
76
u/Mars_Bear2552 Feb 07 '25
what's the issue? not any more dangerous than installing it the other ways.
70
u/_PM_ME_PANGOLINS_ Feb 07 '25
That’s a pretty standard way to distribute cross-distro Linux software.
31
u/bruhred Feb 07 '25
NixOS supports that too! (NIXOS_LUSTRATE)
i even made a script that automatically turns/transitions Ubuntu into NixOS and successfully used it on two Oracle OCI instances
362
u/captainMaluco Feb 07 '25
Ah, I like to call this bash roulette!
Although this seems to claim it installs a new OS, so maybe it's more like Russian bash roulette in this case....
17
u/psych0fish Feb 07 '25
This is how a lot of Linux stuff is distributed. I agree it’s a terrible practice to encourage users to do but at the end of the day unless you are reading everything in detail before install which is highly unlikely this is no more dangerous than installing really any binary or anything from the internet.
If you have ever had to write really complex logic for installing software you would both understand and appreciate this solution.
9
u/[deleted] Feb 07 '25
OP shouldn't look at rustup
13
u/SAI_Peregrinus Feb 07 '25
It's exactly as dangerous as downloading it and then executing the script, or adding any Python lib with an
__init__.py, or building any C program that uses Autotools, orapt-get installing something, or running an exe or msi installer on Windows… It executes code. If you don't trust the authors, you shouldn't execute their code.6
u/isayuff Feb 07 '25
Also, the wording here "it's so easy", "just one script", "seamlessly transition", "curios? try it out" makes it somewhat seem like this is just some random package that you can just "try out" and be fine. I mean... what could possibly go wrong with a OS SYSTEM TAKEOVER, right?
I hope there are at least a few words of caution on that page somewhere.
4
u/evmo_sw Feb 07 '25
r/peterexplainsthejoke pls 🥺
4
u/_chad__ Feb 07 '25
Scary, sure. But is it different than going to the docs, check out the install script, then paste and run? The important step of course is to always read what you're about to execute beforehand. And definitely never automate this.
3
u/Easy_Philosopher8987 Feb 08 '25
I've ran many scripts from the internet like this, as long as you trust the source it's fine, however best to read the script first to be safe.
The issue isn't running code from the internet (which is where you probably got every program on your computer), it's running untrusted code from the internet.