Linux, GNU/Linux, free software...

r/linux1.3M subscribers299 active
"Bricking" a Linux system via editing a single file 101Tips and Tricks

Today, while setting a global envvar via /etc/environment, I found a hilarious way editing /etc/environment can trigger an infinite login loop after rebooting.

  1. Edit /etc/environment
  2. Insert a key, a = but no value, for example: MY_KEY=
  3. Save /etc/environment
  4. Interesting note, before rebooting, nano, micro, rm, vim, vi and anything else will completely segfault when trying to edit /etc/environment
  5. Reboot
  6. You will now be stuck in an infinite loop when trying to log into your system
  7. The two ways to recover is either a USB stick that will mount the /etc partition or booting your system in recovery mode and hoping the segfault issue mentioned in point 4 won't pop up again
Have you ever fixed something and don't even know how you did it?Discussion

As if you had a problem with your Wi-Fi, for example. You tried a bunch of commands and edited some things until it worked, but you don't really know how you solved it. Anyway, it works now! :D

In my case, because it happened recently, I had a power-off time that was too long. It took too long to shut down until I uninstalled some stuff that I don't even know what they do, and it worked anyway.

Newly Returned To Linux, Decided to Give New Life to an Old MachineDiscussion

Hey all! This is my first time posting here, but I've come and gone from the Linux world for a long time. Primarily, I'm a Mac user, but I've always kept Windows around as a compatibility option, and I even dual booted my gaming rig with Ubuntu back in the mid to late 2010s. Well more recently, I've had to switch to Mac more exclusively since a lot of the software I'm most comfortable with for my creative pursuits (podcasting, video editing, etc.) is Mac only (I know there are alternatives to Garageband and iMovie, but they're what my brain likes, and I've learned not to fight that lest I spend more time fighting with new software than creating). I've also been really dismayed by Microsoft's bullshittery these days re: AI and privacy and security. So with an eye to getting away from Windows wherever I can, I decided to dust off my old 2012 Mac Mini, wipe it, and install Ubuntu 24.04 LTS instead. I've then set it up so that its hooked up side by side my M1 Mac Mini on a different HDMI port, with easily swappable peripherals between them. The end result is having both my Mac, and a Linux machine at my disposal whenever needed. This allows me to spend most of my time in macOS, while also being able to easily switch to Ubuntu for gaming of a certain older vintage thanks to the excellent work Valve has done with Proton in Steam. All in all, I'm really impressed with my new setup, and how Linux has basically totally revived and breathed new life into this aging 2012 i5 Mini.

I present to you, the setup I've affectionately taken to calling the MacStac!

[Image]

My Love/Hate Relationship With Linux! (1-Year With Linux A Newbie's Perspective)Fluff

~~~~~~~~~~~~~~~~~
INTRODUCTION:
~~~~~~~~~~~~~~~~~

Hi there fellow Linux users and upcoming Linux users. So as the title suggests I have only used Linux for about a year now so I'm still a newbie when it comes to this OS, so I don't think this will be an interesting read for experienced/pro/master Linux users however if you feel like it is then by all means continue reading. I'm 35 years old (soon to be 36) and this one year of Linux has been wild - starting from zero and working myself up to be able to use the terminal to a certain degree confidently. I have no backstory with Linux and I'm not a programmer by any means I just simply wanted to use an OS that was mine, that I owned without the restrictions that comes with Windows and Mac plus I sought something new and exciting to spend some time on and Linux became that for me, though not without complications given that I knew absolutely nothing about Linux. I've heard so many good things about Linux like; how it was free from bloatware/spyware, how it was so much faster than other OS's out there, how much safer it was to use and how much more privacy oriented it was and I can say without a shadow of a doubt that that is 100% correct in every sense of the word. Linux for me was complicated to learn at first (as you would expect from someone with zero experience) but it really wasn't as difficult as I fooled myself to believe, I mean yes, sure some command lines can be a bit long and difficult to remember but hey just use a notepad like I did - work smarter not harder, right? Anyways I want to take you all on magical ride through reading text of how my progress of using Linux has been and why I have a love/hate relationship with it so without further ado.

~~~~~~~~~~~~~~~~~
PC SPECS:
~~~~~~~~~~~~~~~~~

I'm sure that people would like to know what my desktop PC is rocking so here comes the list for that:

Motherboard: ASUS ROG STRIX B550-F GAMING
CPU: AMD Ryzen 5 5600X
GPU: AMD Radeon RX 6750 XT
RAM: G.Skill Ripjaws V Black DDR4 (2x8GB)
SSD: Samsung 870 EVO
HDD: WD Black Performance
Power Supply: Corsair RM850X

~~~~~~~~~~~~~~~~~
STARTING POINT:
~~~~~~~~~~~~~~~~~

My journey began here on Reddit if I'm being honest where I asked questions on things I didn't fully understand and then did some research on Linux, like for example; what is a package manager, what does 'sudo' mean, what command lines are the most important ones to learn, how do I install this program etc. etc. you know, the typical stuff. After that like so many others have done before me is to download a VM (Virtual Machine) of your choosing, in my case I used 'VirtualBox' because it was easy to setup after watching a quick tutorial and then I began checking for a "distro" also known as "distro hopping" in the Linux community. here's the list in order of my distro hopping:

Pop!_OS
Arch Linux
Zorin OS
Elemental OS
Linux Mint
KDE Neon
Kubuntu

My first choice was 'Arch Linux' (BIG mistake on my part) however I couldn't install that it was a little bit too complicated for my brain so I instead switched to 'Pop!_OS' which was easier to install however I wasn't too fond of their DE (Desktop Environment) plus I had issues getting my second monitor to work and after several hours of researching I couldn't figure it out so I went back to Arch Linux but this time determined to learn how to install it and I actually managed to install the OS without complications but it quickly turned out that Arch Linux is NOT for a beginner like me so I had problems up the wild zoo (ops) but despite all the problems with getting things to work and setting things up how I wanted them to be, I had tons of fun learning until that day comes where my OS broke on me and I probably spent around 3 days trying to fix it and getting it to work to no avail. So I got a little discouraged and a bit nervous. My only option was to reinstall it and try again which I did, mind you this was before I knew that Arch Linux wasn't for beginners. After about 5 months with Arch Linux I finally had gotten enough of it and wanted to change because it wasn't worth trying to fix my OS when I knew I just didn't have the experience to use it fully to all of its advantages so I thought if I download something similar to Windows then maybe I will have better luck at something, how naive I was. Anyways I finally settled upon 'Kubuntu' it had everything I needed and it was relatively easy to use.

~~~~~~~~~~~~~~~~~
DAILY DRIVING LINUX:
~~~~~~~~~~~~~~~~~

Now, please keep in mind that I'm not experienced in using Linux I have to keep repeating that because I can't stress enough how confusing it was for me to go from Windows to Linux - learning, adapting, overcoming and surviving... OK maybe not last part but still, it was a lot of work to do for me! I tried my very best with every distro I used to learn it and when I didn't understand something I would research and if that research made me even more confused, or I didn't understand it or I couldn't find an answer I came here for help. Despite asking people for help on here it didn't yield me any answers in fact it lead to unpleasant people that was far more knowledgeable than me making fun out of me instead, trolling me or just blatantly were rude to me for absolutely no reason, I needed help so I went to the support subreddit for the Linux distro I was using and described my problem(s) as best I could only to be met with the most heinous comments you could imagine, basically everyone told me to: "Google it" and when I replied that I had been doing research before coming here I was down voted to oblivion... it was the most frustrating experience of my life and it certainly didn't help me with wanting to continue using Linux as my main OS. Shutting down someone for being inexperienced is NOT something anyone should do because if that's the case then why go to school, jeez. Sorry but that still frustrates me even to this day that people can behave like that. Anyways, I did the best I could with what little options I had and with each new obstacle that came my way was a real struggle to figure out and I wasn't going to post anything on the Linux subreddits anymore because quite frankly put screw that and screw those people, I found other ways like downloading 'Element' and joining a "forum/room/server" (I actually don't know what they call it) and asked for help there and people actually helped and were friendly, which made me smile. Linux was starting to get fun for me and I learned so much and good lord was it fast on my PC, I mean if I compare it to Windows it is miles ahead in speed both in reading and writing files. I even "RICE:ed" (I think that's what it is called?) my system, customizing it to my liking and installing programs that was honestly way better than the crap you have to pay for on Windows. Even got my games to work without problems but then again I don't really play competitive online games so I never worried about anti-cheat and stuff like that. I got to learn the terminal, what to look out for when installing stuff, checking drives, troubleshooting and other such things which believe it or not was actually fun, sure there were moments where I got headaches but the satisfaction of being able to fix the problem was so gratifying and so rewarding that I completely forgot that I was angry just a few moments ago, it's small things in life that makes it worth it.

~~~~~~~~~~~~~~~~~
THE GOOD & THE BAD:
~~~~~~~~~~~~~~~~~

The bad:

I'm going to try my best to not slip into review territory here and take what I type with a grain of salt because we are diving into what made me "fall out" of using Linux as my main OS and going back to using Windows again despite me absolutely despise using that OS with a burning passion and those words are not to be taken lightly either because I really do not like Windows 8, 10 or 11, basically anything after Windows 7 I don't like. Anyhow what made me switch back wasn't all the troubleshooting I had to do nor was it the incessant researching or even that I couldn't use my VR headset (Valve Index for those who are wondering) but something far simpler. Every time I would update my system to a new version everything would break and I couldn't access my distro anymore so I had to wait for a fix or reinstall my OS (I could also use the nomodeset command I know). This happened way more times than I care to count but more often than not I had to reinstall my OS again and again and again, this was not fun. Also I was dual-booting so my SSD would house Kubuntu and my HDD would have Windows 10 on it, this was so that I could play games that didn't run under Linux, games like but not limited to; Phasmophobia VR, Assetto Corsa VR, Half-Life Alyx, Aircar, Blade & Sorcery and a few hentai games because I'm a man of class. However, the problem with dual-booting became apparent and I have no clue how this happened but the 'Windows Boot Manager' got installed on the Linux partition and that happened twice for some reason and since I couldn't access my Windows drive or my Linux drive I had reinstall both and yes I know there is a way to restore the Windows Boot Manager without reinstalling Windows again but honestly, I forgot how I did it and I didn't save the information on how to do it so I just didn't bother. I'm sure that someone that has the know-how could get their Linux distro (whatever it may be) up and running again with no problems but for me that was it. I lost so much stuff it's not even funny. Also some days I'm not in the mood to troubleshoot my OS and just want it to work, too much of something of the same thing becomes very tiring after a while.

The good:

Linux is fast, simple to use when it comes to installing/uninstalling programs, easy to find errors for programmers, tons of free programs that both better and more stable to use than even some paid-for programs, really freaking secure, privacy oriented, you own your OS and have full control, finding programs that works with Linux is a breeze, Proton/Wine (for those who like gaming), no spam/ad/spy/mal/bloat -ware, customizable to however you want it to look, snap and flat packages that works across the board so you don't feel left out, emulation works straight out of the box, you can throw any controller you have on it and Linux will actually suck its essence in, find the driver and make it work same work with printers, resource load is tiny you could probably install Linux on your TI-82 calculator and it would work no hamsters needed either, features that you always wanted is right here like for example for me it was the 'clipboard' good lord I love that thing, update when you want to no more forced updates and many many more things. Linux is just the best, hands down the best OS that you can get, learn and use plus it's completely free.

~~~~~~~~~~~~~~~~~
CONCLUSION:
~~~~~~~~~~~~~~~~~

The sad reality however is that when I update my system I expect it to work, I expect that the people coding the OS and/or distro knows what they are doing and release something that actually works out of the box and yet it doesn't. I don't want to be trapped in a paranoid mindset of: "Should I update or should I wait? Do I have to save my stuff on an external HDD?" and risk losing everything because I might forget to do that. I will return to Linux someday but for now having the safety net of Windows just working is just way more convenient for me where I don't risk losing or breaking everything just from updating something. I love Linux but I feel defeated from losing important files that I will never get back.

Thank you for reading!

-
2
22m
Pika backup (with BorgBase)Tips and Tricks

Hi, I'm running Fedora KDE on a FrameWork laptop (doensn't matter for the question though). I use Vorta with a BorgBase account. I think that works fine (I can't be sure until I have a crash and have to restore my system :-) ). Now, on mac you have TimeMachine, with which you can browse previous versions of files and folders. I would also like that feature in a back-up system. Pika is a backup solution that works with BorgBase. Would that give such ability in some way? Or what is a good solution for this (preferably without having to pay for yet another service). (I also use NextCloud, which has this ability more or less, but not all my files are in my NextCloud folder)

"I don't have nothing to hide"Discussion

About a month ago I started using Mint daily since I heard about the AI Recall stuff. I had a few discussions with my friends since they saw my desktop when I screenshared something and they asked questions like

"I don't do anything illegal why would I want to hide", "The companies already know everything why even try", "What would they even do with all that data" (after I explained that they sell it to ad companies) "And what will they do"

I started to find it harder and harder to explain the whole philosophy about privacy so what's the actual point?

608
319
1d
how are things going with nvidia 555.58 + wayland?Software Release

with the recent drivers coming out with explicit sync, a lot of people are saying it's finally possible to run wayland if you have an nvidia graphics card. graphics stuff was never my strong suit and i don't quite fully understand what the issues were before, but the 555.58 drivers seem like a big deal. is anyone using them on an nvidia card? how is the experience?

i'm considering switching over at the moment, i just want to keep as few packages as possible on my installation and xorg comes with a lot of them already

Linux on a Mac? Hardware

Asahi had seen a huge improvements with vulkan driver recently and I was wondering if it’s a good idea to buy a mac for Linux in mind. I really like the build quality of a MacBook but I also need Linux working perfectly so is it a good idea?

Guide - Basic forensics for intrusion analysisSecurity

Hello, i’m dinmammasson, and i’m a networking & informationsec student. The text below is an answer i gave to someone who asked how they would find and remove ”malware”, and i opted to give him a general overview of the actions you can take. These steps, and more, is something you’ll learn studying forensics and administration. Please do mind that english is not my first language, and this was written from my phone rather quickly, but exensive enough where i think absolute beginners can get a feel for how they can handle such situations. There are some points left out, if you think there is room for improvement and or want to add something, please feel free to critize and or point out. Skills are best achieved under heat.

This might be reposted in other communities.

THIS IS NOT HOW TO PREVENT SYSTEM INTRUSION, I MIGHT TRY TO WRITE A GUIDE LATER ON

BEGINING OF COMMENT

If you realise that your system has been compromised, the standard protocol is to disconnect it from the network (if it is not segmented already, either way, best is to disconnect), but first, dump the systems memory with a tool such as volatility to capture as much information as possible like network connections, before going offline.

Memory dump in some cases can be enough to detect the ”malware”, but to get a full overview, these are some exensive steps you can take.

After that, you start a forensics process. If you don’t already have have the ELK stack services installed and configured (either way you should also doublecheck manually, which i will explain), you need to manually check all the system logs in /var/log, such as;

  1. Auth.log for authentication events, security related

  2. Syslog for general system activity

  3. boot.log for startup logs

  4. Audit.log if you have the SElinux module enabled and configured (which would prevent many intrustion hadaches, but is a headache and pain itself to set up, mostly used for enterprises)

  5. /var/log/apache/access.log and /var/log/apache/error.log if you’re running apache2 webserver service, for NGINX you’ll find these in /var/log/nginx

Dmesg for kernel messages (this outputs the kernel buffer directly, the buffer has a fixed size, if the buffer is filled, the older logs get overwritten), you can use the (-l) flag to specify level; such as critical, warning etc.

You can also just use journalctl with the kernel flag (-k), which will give you a full kernel log from last boot. Even better if you have persistent logging configured.

Now to memory dumping. Here you can see what processes are being/have been run by what user, information about a module or the process, and their network connection. Here, you can use a multitude of flags to help your search. Look for hidden connections, and or injected code by looking for suspiscious strings, or general artifacts.

Last but not least, check your firewall logs and inbound and outbound packets.

Hope this gives you a good view of the myriad of actions you can take to find harmful activity. Generally, following these steps can show you what was exploited to gain access, so that you can patch it, and for example what process was created as a backdoor after the exploit.

Best wishes, Din mamma

Weather Radar (US only) GIF Script à la Luke SmithTips and Tricks

He posted a video about 4 years ago of a bash script that pulls the most recent GIF of the national weather service's "weather radar," see here for more context: https://youtu.be/qNtjud8zNa0?feature=shared

The webpage he pulled from no longer exists, and there were a lot of comments saying "this no longer works," "can we get an update," etc. I just wanted to let anyone who cares know that this does still work (at least for now) despite the NWS updating the webpage to be more "modern."

It took me a while to find this page, but the new URL is https://radar.weather.gov/ridge/standard/ and add whatever your preferred ICAO airport code is to the url. You'll probably want the one ending in "_loop." Note that "CONUS_loop.gif" gives the contiguous states. "CONUS-LARGE.gif" gives a higher resolution but it will take longer to load. The links you see on this page are constantly updated.

I configured a keybinding in xmonad to run the following bash script consisting of the single command:

mpv --loop-file=inf --no-osc "https://radar.weather.gov/ridge/standard/CONUS_loop.gif"

Works like a charm. It's a bit of a gimmick, but I like it. Sharing here, as opposed to YouTube, as I do not have a google account.

kalc v1.3.0 released, looking for suggestionsSoftware Release
kalc v1.3.0 released, looking for suggestions

after just implementing domain coloring support as a graph type I think this is feature complete now, I still need to properly document stuff but I am wondering if there are any features that I am missing that anyone would like. https://github.com/bgkillas/kalc

13
6
1d
What packages do you always install on Linux? Tips and Tricks

Hi.

I've used Linux in the past. Today, I decided to partition my drive and dual boot Ubuntu.

I wonder, what software do you always install on Linux?

I am a software developer, does anyone have any recommendations ?

277
520
2d
SSH - Minimal GUI-less keyring suggestionsSecurity

I've used Ubuntu and have enjoyed the luxury of the gnome keyring prompting me for my user password instead of my ssh key passphrase.

Then about a year back, I switched to Arch with KDE Plasma, and I enjoyed the same luxury with kwallet.

Now, I've ditched the majority of KDE Plasma (don't ask why the uninstall was so messy...) in favor of sway and a very minimal riced setup with as little GUI as possible. As I mangled my KDE Plasma packages during the KDE removal process, I've done something to make kwalletd6 not start up on boot. PAM something? Don't know, I don't know anything about PAM or D-Bus yet... Everything still works as intended, I just need to launch kwalletd6 before I try sshing anywhere.

But this leaves me at an impasse. I don't "love" the GUI pop-up when I ssh, and I don't use my wallet for anything else. I'd like to get back to a state where I can just use my user password to input the various passphrases for all of my various ssh keys. To get back to a state like that, I could do one of the following:

  1. Get kwalletd6 to start when requested once again. This isn't my favorite solution, because I've actually soured on the KDE Plasma environment a bit. I love the idea of completely getting away from KDE. But that doesn't mean I want to run right into the arms of GTK with a seahorse-like solution.
  2. Make a custom PAM solution. I see on the Arch wiki page for pam_ssh that you can do some fancy PAM things to add ssh keys to the ssh agent, but that wiki page does have a pretty scary "if you screw this up you'll need to recover your Arch from a backup CD" warning. Although I'd think you could just boot on a USB and fix the file without having to boot into the broken arch OS? Right? Anyway, beyond this scary warning, this also still involves messing with an etc file that would mess things up if I didn't have the pam_ssh module installed anymore. I'd want to couple this custom pam_ssh file to the pam_ssh AUR installation so that if I ever uninstall the pam_ssh package it would also remove my custom pam file.
  3. A custom script that works with an encrypted file containing my passphrases. I'm thinking a gpg-encrypted file that encrypts the file with my user password. I could set up the SSH_ASKPASS environment variable to point to a bash script that, upon first invocation, decrypts the passphrases file and loads them into ssh-agent. First of all, I'm not actually sure this route would work. Second of all, if I leave the passphrases on my computer and encrypt those passphrases with a different passphrase, have I actually done anything more than just locking my ssh keys with my user password? I guess I could leave this encrypted file in one of my separate luks encrypted partitions... maybe that means this would be a better route? Lastly, it sounds like if I go with this option, I'm basically just handrolling my own password manager. That could be a bad thing since I'm not a security expert, but it could also be a good thing because it would be a very simple/uncomplicated solution that relies almost entirely just on reliable/ubiquitous programs such as ssh-agent and gpg. I like this option because there would be no added software packages. Just a simple script and an ecrypted file.

I know programs like KeePass exist, but I don't know if I want yet another password manager.

So what do we think? Am I crazy person? Am I missing a really obvious solution?

Archboot 2024.06 - Arch Linux ISOs/UKIs released Software Release
Archboot 2024.06 - Arch Linux ISOs/UKIs released

[Image]

Hi folks,

New month, a new release with new features arrived:

Archboot Homepage

Highlights:

  • systemd 256.x
  • force OpenSSH login through ttyd
  • Added bat dust eza fd fzf procs ripgrep rustscan sd

Setup:

  • Swap File Support
  • User Management Support
  • Bash / Zsh Switch
  • More Descriptions And UI Improvement

Further changes are listed on the complete Changelog.

Have fun,

tpowa

Passed my Linux+ with 6 days of prep. Tips and Tricks

Hey there r/linux!

Passed my CompTIA Linux+ just a little bit ago with 6 days of prep and no Linux knowledge base before that. I have my A+ and Sec+ so there was some familiarity with these topics. There was a post on this community that said it’s a good test to take for broadening understanding of various OSs and computers in general.

My background is predominantly military and emergency services.

Hopefully this post helps other people on the fence with taking it. Here’s what I did to pass:

-Printed off the exam objectives from comp tia.

-made a 3x5 flashcard for every topic using GPT4 to define the topics and relate the topics to windows OS. I made over 600 flashcards this week. ($20)

-Used an app called IT security to drill questions. It gave me a question deck of 500 questions I paid for this service and answered all 500 questions. ($20)

I had a raspberry pi as my Linux computer that I would run commands through and learn how the commands work. ($100)

I can say that I will never use Linux at work since I work in an environment that will never leave windows OS. My understanding of OSs (even windows) is better now and I’m really glad I took this cert.

How is GNOME considered user friendly?GNOME

GNOME quite literally works better when you have DE conflict. I had KDE and GNOME installed, then GNOME had this weird line on my taskbar. It wasn't a hardware issue, but it pissed me off enough that I tried to reset, and that seemed to work, until it didn't. GNOME's customizing is IMPOSSIBLE. There's a million theming tools, and tutorials. How am I supposed to rtfm, WHEN ALL THE MANUALS ARE CONFLICTING?!!? I've had to swap back to macOS for main development! I love Fedora to bits, but I think I'm gonna have to swap to NixOS.