|
Sadly no, this was in a recovery shell so ctrl+c does nothing. It's fine as said controller meant I could walk away and do other things.
|
# ? Jul 5, 2023 14:12 |
|
|
# ? May 23, 2024 21:28 |
|
I've never ended up with a usable file system once fsck gets into the -y/hold the key down territory. The entire disk ends up in lost+found.
|
# ? Jul 5, 2023 14:23 |
|
Yep! What was interesting was it was a virtual disk and despite the drive it was hosted on being fine, after the fsck didn't fix it I tried just reinstalling the OS but that failed too because the virtual disk was still erroring out.
|
# ? Jul 5, 2023 14:25 |
|
hazzlebarth posted:That is the command that caused the sudo prompt. Can you check with "grep -r chown ~FSF/.*" to search for chown in your dot-files? I think I figured it out, and I'm almost embarrassed to reveal it because I feel stupid as gently caress. A few days ago, I was moving a bunch of files from a USB stick to my system, and I noticed that everything I was moving ended up belonging to root and being executable (even mp3 files). I wrote a simple script that takes a file name as its input and does chown [FSF] and chmod u-x on that one file to eliminate that nonsense. Making that script non-executable and then doing source .bashrc eliminates the problem of having to type in my sudo password when my terminal opens. I know what you all are probably going to say: "never put scripts that use poo poo like chown in your ~/bin directory" and "why the gently caress were you doing that via a script?" It's a bit funny because I was telling a friend recently: Linux has the ability to make you feel like the king of the world one moment and like the biggest loving idiot who ever lived the next. F_Shit_Fitzgerald fucked around with this message at 14:46 on Jul 5, 2023 |
# ? Jul 5, 2023 14:41 |
|
What did you name the script? .bashrc shouldn't be calling anything like that?
|
# ? Jul 5, 2023 14:50 |
|
Tesseraction posted:What did you name the script? .bashrc shouldn't be calling anything like that? I just named it "mine". bashrc doesn't call it at all but the system doesn't like for it to be sitting in my bin directory, I guess.
|
# ? Jul 5, 2023 14:52 |
|
Something else is going on but it may not be worth digging into, no login process or system service is going to be executing scripts in ~/bin unless it's explicitly told to. Best I got is something is sourcing everything in ~/bin, but again, it would have to be told to do that. That's not default config for anything. Maybe you could make a new script and have it grep $PPID out of a ps command and find out what's calling it.
|
# ? Jul 5, 2023 14:57 |
|
F_Shit_Fitzgerald posted:I just named it "mine". bashrc doesn't call it at all but the system doesn't like for it to be sitting in my bin directory, I guess.
|
# ? Jul 5, 2023 15:10 |
|
Yeah, it's not *massively* important but I'm really curious how your bin directory is running automatically. Can you show us any custom lines you've added to your bash (anonymised as needed) or at least every code:
code:
|
# ? Jul 5, 2023 15:10 |
|
Sure. My .bashrc file is completely normal aside from the last couple of lines:code:
dayOfYear is the "count what day of the year it is and how far into the summer we are" script I wrote. It's simply a calculation. fortune is the little quote displayer thing that Distrotube has talked about before. ...and of course starship is my terminal line customization. I don't know if it makes a difference but dayOfYear is set up to run without ./
|
# ? Jul 5, 2023 15:18 |
|
Is dayOfYear in ~/ or ~/bin/ ?
|
# ? Jul 5, 2023 15:28 |
|
Tesseraction posted:Is dayOfYear in ~/ or ~/bin/ ? ~/bin Maybe I should have done ~/bin/dayOfYear instead..
|
# ? Jul 5, 2023 15:29 |
|
Why is ~/bin in your $PATH? Have you modified it in .bashrc?
|
# ? Jul 5, 2023 15:34 |
|
~/bin is a righteous place to keep your little scripts, and has been for 40+ years.
|
# ? Jul 5, 2023 15:37 |
|
Contents of $PATH aren't really relevant here. Sure it's a questionable practice (even though everyone does it) but entries in there aren't going to cause scripts to run on login.
|
# ? Jul 5, 2023 15:37 |
|
Tesseraction posted:Why is ~/bin in your $PATH? Have you modified it in .bashrc? No, I haven't messed with anything about the lines I added at the bottom of .bashrc. e: My path is /home/FSF/.cargo/bin:/home/FSF/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin F_Shit_Fitzgerald fucked around with this message at 15:55 on Jul 5, 2023 |
# ? Jul 5, 2023 15:41 |
|
Subjunctive posted:~/bin is a righteous place to keep your little scripts, and has been for 40+ years. xzzy posted:Contents of $PATH aren't really relevant here. Sure it's a questionable practice (even though everyone does it) but entries in there aren't going to cause scripts to run on login. Sure, but I'm curious how it got onto path - to my knowledge that is not there by default so I was wondering if whatever's adding it is also accidentally running everything in there once.
|
# ? Jul 5, 2023 15:53 |
|
Tesseraction posted:Sure, but I'm curious how it got onto path - to my knowledge that is not there by default so I was wondering if whatever's adding it is also accidentally running everything in there once. code:
|
# ? Jul 5, 2023 16:49 |
|
F_Shit_Fitzgerald posted:Linux has the ability to make you feel like the king of the world one moment and like the biggest loving idiot who ever lived the next. F_Shit_Fitzgerald posted:I think I figured it out, and I'm almost embarrassed to reveal it because I feel stupid as gently caress.
|
# ? Jul 5, 2023 17:15 |
|
ExcessBLarg! posted:
Huh, interesting. Something new to think about with Debian-based. F_Shit_Fitzgerald posted:No, I haven't messed with anything about the lines I added at the bottom of .bashrc. Just to sate my curiousity could try grepping for the word "mine" in your auto-run commands like dayOfYear. I'm just academically curious at this point though.
|
# ? Jul 5, 2023 17:21 |
|
Tesseraction posted:Huh, interesting. Something new to think about with Debian-based. ~/.local/bin seems to be the new standard for systemd distros, not just debian
|
# ? Jul 5, 2023 17:25 |
~/.local/bin isn't part of the XDG Base Directory standard, but it's a recommendation made by it in some places, I think.
|
|
# ? Jul 5, 2023 17:35 |
|
What's wrong with ~/bin
|
# ? Jul 5, 2023 17:39 |
|
F_Shit_Fitzgerald posted:I think I figured it out, and I'm almost embarrassed to reveal it because I feel stupid as gently caress. Just a heads up - chown has a "-R" flag that allows you to change ownership of a directory and all its contents, so you don't have to write a script that does it one by one. And when you do write scripts, you should probably name them with the ".sh" extension - it really helps to be able to quickly tell what's a script and what's not. Also, I'm guessing the reason all the files on your USB stick were owned by root was because it was a NTFS-formatted drive and you mounted the drive as root. I'm still not sure why scripts in your ~/bin directory are being run - I suggest writing a script like a previous poster suggested that echos out the PPID, maybe something like: code:
|
# ? Jul 5, 2023 17:44 |
|
Satire Forum Mom posted:Just a heads up - chown has a "-R" flag that allows you to change ownership of a directory and all its contents, so you don't have to write a script that does it one by one. Yep, probably. I mostly use the USB stick to move stuff from my old Windows laptop to Linux - mostly music and picture files. Every time I connect the stick to Windows it always pops up an annoying "This drive needs to be repaired" message. Will do on the .sh extension. I try to come up with creative names for my scripts but it's good "opsec". quote:make it executable, place it in your ~/bin, and then run "ps aux | grep WHATEVER_THE_PPID_WAS" to find out what was running the script. OK, easily done. Here's what the result was: code:
F_Shit_Fitzgerald fucked around with this message at 17:55 on Jul 5, 2023 |
# ? Jul 5, 2023 17:53 |
VostokProgram posted:What's wrong with ~/bin If anything, ~/.local/bin/ is less sensible, since by definition, the user's home directory is always part of the local installation - even if you use a combination of sysutils/pam_xdg and sysutils/pam_mkhomedir on a thin client.
|
|
# ? Jul 5, 2023 17:54 |
|
VostokProgram posted:What's wrong with ~/bin Like if you want a ~/bin that's fine. Preferable, even, if you write a lot of scripts that you want to be able to call by name. But if you're just doing a user-installation of an updated version of Python or something, you might not want a ~/bin, ~/lib, etc., to suddenly appear among your well-organized ~/Downloads, ~/Pictures, ~/Videos, etc. ExcessBLarg! fucked around with this message at 18:53 on Jul 5, 2023 |
# ? Jul 5, 2023 17:55 |
|
The concern with a ~/bin is any process you run can drop a script in there and wait for you to run it and "do bad stuff." Like say it put a script named 'ls' in there and had it send your ssh private keys to a remote server. Or whatever scenario you can come up with, it's a "security risk." One that requires you to execute sketchy programs off the internet but still a risk. As a normal user can't write to /usr/bin the same concern doesn't exist there.
|
# ? Jul 5, 2023 18:01 |
|
F_Shit_Fitzgerald posted:Yep, probably. I mostly use the USB stick to move stuff from my old Windows laptop to Linux - mostly music and picture files. Every time I connect the stick to Windows it always pops up an annoying "This drive needs to be repaired" message. Oh, I should have specified you're going to have to open up a new terminal window and then check the text file for the PPID and run ps aux | grep.
|
# ? Jul 5, 2023 18:08 |
|
xzzy posted:The concern with a ~/bin is any process you run can drop a script in there and wait for you to run it and "do bad stuff."
|
# ? Jul 5, 2023 18:20 |
|
xzzy posted:The concern with a ~/bin is any process you run can drop a script in there and wait for you to run it and "do bad stuff." Like say it put a script named 'ls' in there and had it send your ssh private keys to a remote server. Or whatever scenario you can come up with, it's a "security risk." One that requires you to execute sketchy programs off the internet but still a risk. seems like a lot of work versus just sending the keys to the server when the original process is running, but they can also just write to .profile or something similar if they want to interpose something. $PATH is not a line of defense against malware, other than maybe making sure that you don’t have world-writable entries in it on multi-user machines.
|
# ? Jul 5, 2023 18:26 |
|
ExcessBLarg! posted:There's innumerable ways that non-sandboxed user-level processes can persist themselves even without ~/bin, which is why there's been so much focus on sandboxing over the past decade. wouldn't ~/.local/bin also have owner write privileges so the same thing can be done?
|
# ? Jul 5, 2023 18:28 |
|
Subjunctive posted:seems like a lot of work versus just sending the keys to the server when the original process is running, but they can also just write to .profile or something similar if they want to interpose something. $PATH is not a line of defense against malware, other than maybe making sure that you don’t have world-writable entries in it on multi-user machines. Yeah it's always felt like a specious concern to me, but that's what people have said about it for like 30 years.
|
# ? Jul 5, 2023 18:31 |
|
IT departments jumping at shadows is how you get poo poo like the antivirus using 25% of my CPU while linking our own software
|
# ? Jul 5, 2023 18:32 |
|
I think the only reason for ~/.local/bin instead of ~/bin is that they were adding lib and share and so on to ~/.local in mirror of the traditional hierarchy under /usr. So as long as you're doing that re-org you might as well move bin in there too. Nothing to do with security or sandboxing.
|
# ? Jul 5, 2023 18:45 |
|
BattleMaster posted:wouldn't ~/.local/bin also have owner write privileges so the same thing can be done? xzzy posted:Yeah it's always felt like a specious concern to me, but that's what people have said about it for like 30 years. Edit: To be clear, I'm not saying ~/.local/bin is any more/less problematic than ~/bin or that ~/bin is problematic in the first place. I'm saying ~/.local/bin exists, in part, because users-of-today might want to have user-installed packages without cluttering their visible home directory. ExcessBLarg! fucked around with this message at 18:54 on Jul 5, 2023 |
# ? Jul 5, 2023 18:50 |
|
yeah i use ~/.local/* over ~/* just to keep the homedir tidy
|
# ? Jul 5, 2023 18:53 |
Truga posted:yeah i use ~/.local/* over ~/* just to keep the homedir tidy I've been doing that for going on 20 years for my scripts, and it's worked fine.
|
|
# ? Jul 5, 2023 19:06 |
|
Klyith posted:I think the only reason for ~/.local/bin instead of ~/bin is that they were adding lib and share and so on to ~/.local in mirror of the traditional hierarchy under /usr. So as long as you're doing that re-org you might as well move bin in there too. Yeah, I agree with that change both aesthetically and also making it even more obvious what is user-specific and what is system-wide.
|
# ? Jul 5, 2023 19:08 |
|
|
# ? May 23, 2024 21:28 |
|
BlankSystemDaemon posted:If that's the goal, just call it ~/.bin. I think the idea is that .local/ is the equivalent of /usr/local but just for that user, so it will have a hierarchy within it. I think.
|
# ? Jul 5, 2023 19:10 |