ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Linux user

    Scheduled Pinned Locked Moved IT Discussion
    linuxsecurity
    18 Posts 5 Posters 2.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • scottalanmillerS
      scottalanmiller @Alex Sage
      last edited by

      @anonymous said:

      But isn't it true that if I run sudo I can do just as much harm as running as root? If that is true, whats the difference?

      Couple of things...

      • It blocks most accidental typos. If you are just doing normal tasks, no reason to risk exposing the system. If you are typing rm -rf /opt/mytestfiles and accidentally hit enter too soon as root, the system is dead. Do it as a normal user, nothing happens.
      • It makes you aware when you are doing something risky. If it suddenly asks you for sudo access, you can stop and think whether you meant to do that thing or not.
      • It stops malware that gets to you as the end user from escalating to root. Click the wrong website link as root, and your system is pwned. Do it as an end user, you are completely safe (at a system level.) No Linux malware on the market can breach the root escalation point (today.)
      • Not really applicable to single user but... tracking. You'll have far better visibility into who is using root. Helps you to know if your account or the root account is compromised.
      A 3 Replies Last reply Reply Quote 1
      • scottalanmillerS
        scottalanmiller @Alex Sage
        last edited by scottalanmiller

        @anonymous said:

        Personally, I create a account for another reason. I like to use SSH keys, and SSH keys on a root account is bad form. Also, I disable root login via SSH - this just makes good security sense. If I need access I have to access via console.

        SSH Keys to root are only bad form because it is bad form to ever run as the root account. SSH Keys to root on their own are not bad at all. Root remote access, also only bad because of inheritance.

        All of those, along with the base question of why not to run as root, are all because of "bad form."

        1 Reply Last reply Reply Quote 2
        • A
          Alex Sage @scottalanmiller
          last edited by Alex Sage

          @scottalanmiller said:

          • It blocks most accidental typos. If you are just doing normal tasks, no reason to risk exposing the system. If you are typing rm -rf /opt/mytestfiles and accidentally hit enter too soon as root, the system is dead. Do it as a normal user, nothing happens.

          However if I type:

          sudo rm -rf /opt/mytestfiles
          

          Then it's game over right? I think I remember you saying that you remove the need for retype your password to use sudo?

          scottalanmillerS 1 Reply Last reply Reply Quote 0
          • A
            Alex Sage @scottalanmiller
            last edited by Alex Sage

            @scottalanmiller said:

            • It makes you aware when you are doing something risky. If it suddenly asks you for sudo access, you can stop and think whether you meant to do that thing or not.

            For some people I am sure that's true, but you would be surprised how often I see someone using sudo before EVERY command 😧

            scottalanmillerS 1 Reply Last reply Reply Quote 0
            • scottalanmillerS
              scottalanmiller @Alex Sage
              last edited by

              @anonymous said:

              @scottalanmiller said:

              • It blocks most accidental typos. If you are just doing normal tasks, no reason to risk exposing the system. If you are typing rm -rf /opt/mytestfiles and accidentally hit enter too soon as root, the system is dead. Do it as a normal user, nothing happens.

              However if I type:

              sudo rm -rf /opt/mytestfiles
              

              Then it's game over right? I think I remember you saying that you remove the need for retype your password to use sudo?

              I do, but by default you normally do not.

              1 Reply Last reply Reply Quote 1
              • A
                Alex Sage @scottalanmiller
                last edited by Alex Sage

                @scottalanmiller said:

                • It stops malware that gets to you as the end user from escalating to root. Click the wrong website link as root, and your system is pwned. Do it as an end user, you are completely safe (at a system level.) No Linux malware on the market can breach the root escalation point (today.)

                I assume we are talking about servers here? I never browse websites on my servers

                I find it very hard to do from the command line 😉

                1 Reply Last reply Reply Quote 1
                • scottalanmillerS
                  scottalanmiller @Alex Sage
                  last edited by

                  @anonymous said:

                  @scottalanmiller said:

                  • It makes you aware when you are doing something risky. If it suddenly asks you for sudo access, you can stop and think whether you meant to do that thing or not.

                  For some people I am sure that's true, but you would be surprised how often I see someone using sudo before EVERY command 😧

                  that's extremely weird. And only works if they disable passwords for it (which I do, but I rarely recommend.)

                  1 Reply Last reply Reply Quote 0
                  • A
                    Alex Sage
                    last edited by

                    @scottalanmiller not trying to argue, just working it out in my head 🙂

                    At the end of the day my point is that you can't fix ignorance. If you don't know, you don't know. The key is know what your doing BEFORE you do it. And always have a backup just in case 😉

                    1 Reply Last reply Reply Quote 1
                    • brianlittlejohnB
                      brianlittlejohn
                      last edited by

                      0_1455289532043_sandwich.png

                      I'm sure this goes against every best practice, but when I'm doing a bunch of admin stuff i issue a sudo bash and open up a new bash shell with sudo privileges

                      scottalanmillerS 1 Reply Last reply Reply Quote 0
                      • scottalanmillerS
                        scottalanmiller @brianlittlejohn
                        last edited by

                        @brianlittlejohn said:

                        0_1455289532043_sandwich.png

                        I'm sure this goes against every best practice, but when I'm doing a bunch of admin stuff i issue a sudo bash and open up a new bash shell with sudo privileges

                        Not uncommon, and I do that a bit too (I use sudo -i su) but one of the good things about that is that it still tracks your user, it does not treat you as root for auditing.

                        1 Reply Last reply Reply Quote 2
                        • 1 / 1
                        • First post
                          Last post