this post was submitted on 15 Nov 2025
61 points (95.5% liked)
Linux
59677 readers
794 users here now
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
founded 6 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I guess that depends on distro, because sudo on OpenSUSE requires root password, so a script isn't doing anything unless you enter the password
The script would place its own version of sudo in your
$PATHand wait for you to enter the password. Then it has it and can do what it likes with the information.Then it'd just tell you "wrong password" and forward you to the real sudo so that you can keep on working like nothing happened.
Edit: Or even better, pass your own commands to take over the whole system to the real sudo.
Disable aliasing I guess, or change to root owner, read only permission
Yes, every distro requires a password for sudo. That's the whole point of it. But editing .bashrc does not require sudo. You can add aliases and functions to .bashrc. A malicious script can append to .bashrc, and by doing so, it can alias sudo to be whatever command it wants. For instance, a malicious function. So the next time you run sudo it runs the malicious command, instead, which itself can act just like sudo and prompt you for your password. So now you just entered your password into a malicious function. Do you see the problem with this?
Then lock bash rc as read-only and root permission only, or disable aliasing altogether I guess