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

      How dare you using a 21st century terminal editor that keeps you sane? You’re supposed to learn a whole new set of archaic key bindings! And suffer!

  • bitchkat@lemmy.world
    link
    fedilink
    English
    arrow-up
    16
    ·
    7 hours ago

    Had an idiot “fix” a permission problem by running “sudo chmod -R 777 /”

    And that is why sudo privileges were removed for the vast majority of people.

  • GreenKnight23@lemmy.world
    link
    fedilink
    arrow-up
    37
    arrow-down
    1
    ·
    edit-2
    17 hours ago

    why tho?

    If it’s a file I have to modify once why would I run:

    sudo chmod 774 file.conf

    sudo chown myuser:myuser file.conf

    vi file.conf

    sudo chown root:root file.conf

    sudo chmod 644 file.conf

    instead of:

    sudo vi file.conf

    1000001464

  • Sixty@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    15
    ·
    15 hours ago

    sudo dolphin

    Then I act like a Windows user and go there via the GUI because I didn’t feel like learning how to use nano.

  • hddsx@lemmy.ca
    link
    fedilink
    arrow-up
    19
    ·
    19 hours ago

    Sorry, user babe is not in the sudoers file. This incident will be reported

  • aesthelete@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    16 hours ago

    This is definitely the way for configuration files that you shouldn’t change permissions or ownership on but only want to modify a few times.

    However, I find chmod easier to use without reference by using the ugoa (+/-) rwxXst syntax rather than the numbers.

  • SleepyPie@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    18 hours ago

    If it’s all my system should I really care about chown and chmod? Is the point that automatic processes with user names like www-data have to make edits, and need permission to do so, and that’s it?

    Newish Linux user btw

    • corsicanguppy@lemmy.ca
      link
      fedilink
      English
      arrow-up
      4
      ·
      18 hours ago

      Short answer: yes.

      One of the tenets of security is that a user or process should have only enough access to do what it needs, and then no more. So your web server, your user account, to your mail server, should have exactly what they need, and usually that’s been intricately planned by the distro.

      If you subvert it you could be writing files as root that www-data now can’t read or write. This kind of error is sometimes obvious and sometimes very subtle.

      Especially if you’re new to this different access model, tread carefully.

      Great news! If you need it up, many distros are really great at allowing you cm to compare permissions and reset them. The bad news is that maybe you’re not on one of those. But you could be okay.

  • juipeltje@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    19 hours ago

    I’m not sure if that’s the joke and it flew over my head but isn’t editing with sudo what you should be doing anyway if it’s a system level file? You shouldn’t change permissions unless the file is actually supposed to be owned by your user.

    • anton@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      3
      ·
      3 hours ago

      You are supposed to run sudoedit.
      This command creates a temporary copy, opens it in you editor of choice and overwrites the protected file when the temp file changes.
      That way the editor doesn’t run as root.
      You can see the difference if you run shell command, like whoami, in vim.