Civilloquy
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Morph9@lemmy.zip to linuxmemes@lemmy.worldEnglish · 18 hours ago

Sudo disbelief

lemmy.zip

external-link
message-square
62
fedilink
222
external-link

Sudo disbelief

lemmy.zip

Morph9@lemmy.zip to linuxmemes@lemmy.worldEnglish · 18 hours ago
message-square
62
fedilink
alert-triangle
You must log in or register to comment.
  • BeatTakeshi@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    11 minutes ago

  • SilentObserver@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    2 hours ago

    Don’t need sudo if you’re always root.

    Now excuse me. I need to call the bank and find out why my checking account is suddenly $0.

  • DarkSideOfTheMoon@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    4 hours ago

    I normally disable root, so I don’t think su would work. Never tried, so maybe I am using it wrong.

  • w3ird_sloth@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    6 hours ago

    doas

  • luciferofastora@feddit.org
    link
    fedilink
    arrow-up
    13
    ·
    11 hours ago

    I once did a HackTheBox where the privilege escalation weakness was a cronjob running a script. I’m not sure if I correctly remember all the details, but I think it read some parameters from a file and fed them to some other script. Since it had something to do with the webserver the user was administrating, they needed write access to the file, granted via ACL. That took me a while to spot, actually. Not sure why, but ACL is a constant blind spot for me. As for passing the parameters, you can just append the contents of the file to the command and pipe it to bash.

    I don’t recall what the normal script did, but it needed writing permissions for something. The proper way to do this would be ACL, but I guess I’m not the only one with a blind spot. The easy way to ensure the script can do whatever it needs to is to sudo the whole thing.

    So what do you do if you have a script running every ten minutes, reading the first line of a file you can edit, then executing it with superuser privileges?

    Whatever the fuck you want.

    • SilentObserver@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      2 hours ago

      Huh. I might need to take a peek at one of my cronjobs now. 😂

    • FauxLiving@lemmy.world
      link
      fedilink
      arrow-up
      7
      ·
      10 hours ago

      You mean we shouldn’t have a ‘while true; eval $file’ job running as root??? Goddammit, someone help me fix my remote admin script!!!

  • Steamymoomilk@sh.itjust.works
    link
    fedilink
    arrow-up
    7
    ·
    11 hours ago

    Sudo !!

    👌👌👌 perfection

  • SAF77@lemmy.world
    link
    fedilink
    arrow-up
    7
    arrow-down
    1
    ·
    12 hours ago

    All you need is a single sudo su, correct.

    • ByteOnBikes@discuss.online
      link
      fedilink
      arrow-up
      10
      arrow-down
      1
      ·
      11 hours ago
      1. Turn on monitor.
      2. Sudo su
      3. Copying and pasting terminal commands I find off the Internet
      4. Living life to the fullest.
      • tourist@lemmy.world
        link
        fedilink
        arrow-up
        8
        ·
        9 hours ago
        alias rm="rm -rf";
        alias cd="rm ~/Desktop; cd";
        pyhton="shutdown now"
        
      • FauxLiving@lemmy.world
        link
        fedilink
        arrow-up
        3
        ·
        10 hours ago

        People wouldn’t just go on the Internet and lie… would they?

  • TomMasz@piefed.social
    link
    fedilink
    English
    arrow-up
    28
    ·
    edit-2
    16 hours ago

    How else will the OS know I’m serious ?

    • lost_faith@lemmy.ca
      link
      fedilink
      arrow-up
      6
      ·
      15 hours ago

      “Yes, Do as I say!”

  • irelephant [he/him]@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    4
    ·
    11 hours ago

    Sudo -i

  • nieceandtows@programming.dev
    link
    fedilink
    arrow-up
    39
    arrow-down
    2
    ·
    18 hours ago

    Yeah I only use sudo once, for the su.

    • Hawke@lemmy.world
      link
      fedilink
      arrow-up
      28
      ·
      17 hours ago

      … but why? “sudo -i” is a thing. Why get another program involved?

      • nieceandtows@programming.dev
        link
        fedilink
        arrow-up
        3
        arrow-down
        1
        ·
        17 hours ago

        It’s easier to just call su once and run every single command as root rather than having to randomly use sudo for some commands and not for others (/s if it’s not obvious)

        • Hawke@lemmy.world
          link
          fedilink
          arrow-up
          5
          ·
          17 hours ago

          But you can do that without involving ‘su’.

          • slothrop@lemmy.ca
            link
            fedilink
            English
            arrow-up
            6
            ·
            edit-2
            17 hours ago

            I don’t use sudo.
            Ever.
            It’s disabled by default in slackware, and I don’t know why it’s even there.

          • nieceandtows@programming.dev
            link
            fedilink
            arrow-up
            4
            arrow-down
            1
            ·
            17 hours ago

            Tell me how you can run rm rf / no preserve root without su, I’m waiting.

            • Hawke@lemmy.world
              link
              fedilink
              arrow-up
              11
              ·
              17 hours ago

              Is this some kind of joke going over my head or something?

              Run “sudo -i” then run “rm -rf --no-preserve-root”

              • nieceandtows@programming.dev
                link
                fedilink
                arrow-up
                3
                ·
                15 hours ago

                Yeah I’m just joking around. I pretty much never use su except in rare cases

    • stupidcasey@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      11 hours ago

      I just delete every user but root.

  • dream_weasel@sh.itjust.works
    link
    fedilink
    arrow-up
    11
    ·
    15 hours ago

    sudo man sudo

  • Samsy@lemmy.ml
    link
    fedilink
    arrow-up
    27
    arrow-down
    1
    ·
    18 hours ago

    But rm -fr / * seems not to work for removing the French language pack. Can someone confirm if it works with sudo?

    • plateee@piefed.social
      link
      fedilink
      English
      arrow-up
      14
      ·
      14 hours ago

      Ah, I see your problem, you need to add --no-preserve-root.

      See the French are super into wine - and grape vines are notoriously hard to get rid of, so if you want to really get rid of the French language pack, you need to rip that grapevine out by the root (e.g. don’t preserve the root). Otherwise, the French language pack will just grow back harder and Frenchier than before.

      Sacrebleu!

      • Samsy@lemmy.ml
        link
        fedilink
        arrow-up
        2
        ·
        11 hours ago

        Mondieu!

        How could I have forgotten that?

  • FancyPantsFIRE@lemmy.world
    link
    fedilink
    English
    arrow-up
    12
    arrow-down
    1
    ·
    17 hours ago

  • Diplomjodler@lemmy.world
    link
    fedilink
    arrow-up
    10
    ·
    17 hours ago

    Pfft. Real men always log in as root.

    • kill_dash_nine@lemmy.zip
      link
      fedilink
      arrow-up
      1
      ·
      4 hours ago

      You got that right. https://www.garyshood.com/root/

  • Naich@lemmings.world
    link
    fedilink
    arrow-up
    4
    ·
    14 hours ago

    Just once.

    sudo -s

linuxmemes@lemmy.world

linuxmemes@lemmy.world

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !linuxmemes@lemmy.world

Hint: :q!


Sister communities:
  • !tech_memes@lemmy.world
  • !memes@lemmy.world
  • !lemmyshitpost@lemmy.world
  • !risa@startrek.website

Community rules (click to expand)

1. Follow the site-wide rules
  • Instance-wide TOS: https://legal.lemmy.world/tos/
  • Lemmy code of conduct: https://join-lemmy.org/docs/code_of_conduct.html
2. Be civil
  • Understand the difference between a joke and an insult.
  • Do not harrass or attack users for any reason. This includes using blanket terms, like “every user of thing”.
  • Don’t get baited into back-and-forth insults. We are not animals.
  • Leave remarks of “peasantry” to the PCMR community. If you dislike an OS/service/application, attack the thing you dislike, not the individuals who use it. Some people may not have a choice.
  • Bigotry will not be tolerated.
3. Post Linux-related content
  • Including Unix and BSD.
  • Non-Linux content is acceptable as long as it makes a reference to Linux. For example, the poorly made mockery of sudo in Windows.
  • No porn, no politics, no trolling or ragebaiting.
  • Don’t come looking for advice, this is not the right community.
4. No recent reposts
  • Everybody uses Arch btw, can’t quit Vim, <loves/tolerates/hates> systemd, and wants to interject for a moment. You can stop now.
5. 🇬🇧 Language/язык/Sprache
  • This is primarily an English-speaking community. 🇬🇧🇦🇺🇺🇸
  • Comments written in other languages are allowed.
  • The substance of a post should be comprehensible for people who only speak English.
  • Titles and post bodies written in other languages will be allowed, but only as long as the above rule is observed.
6. (NEW!) Regarding public figures

We all have our opinions, and certain public figures can be divisive. Keep in mind that this is a community for memes and light-hearted fun, not for airing grievances or leveling accusations.

  • Keep discussions polite and free of disparagement.
  • We are never in possession of all of the facts. Defamatory comments will not be tolerated.
  • Discussions that get too heated will be locked and offending comments removed.

 

Please report posts and comments that break these rules!


Important: never execute code or follow advice that you don’t understand or can’t verify, especially here. The word of the day is credibility. This is a meme community – even the most helpful comments might just be shitposts that can damage your system. Be aware, be smart, don’t remove France.

Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 1.3K users / day
  • 2.7K users / week
  • 5.66K users / month
  • 12.5K users / 6 months
  • 1 local subscriber
  • 28.9K subscribers
  • 1.66K Posts
  • 65.8K Comments
  • Modlog
  • mods:
  • Kevin@lemmy.world
  • zephyr@lemmy.world
  • rtxn@lemmy.world
  • BE: 0.19.5
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org