Skip to content

Latest commit

 

History

History
76 lines (44 loc) · 1.51 KB

File metadata and controls

76 lines (44 loc) · 1.51 KB

sudo

basic knowledge

  1. a command that can operate like root

  2. only the user who has administrator privileges can use sudo

    • how to check if the user has administrator privileges

      • list all members in admin group

        open the terminal:

        dscl . read /groups/admin | grep GroupMembership 

        expected output:

        GroupMembership: root adm

        it shows only root and adm have administrator privileges in this computer

      • check out id

        open the terminal:

        dscl . read /groups/admin | grep PrimaryGroupID 

        expected output:

        PrimaryGroupID: 80

        check out if this user is in admin(No. 80) group:

        id
  3. read the user manual of sudo

    open the terminal:

    man sudo

root in macOS

  1. default off

  2. can do a lot of things to damage your computer

  3. recommend not to use it (use sudo instead)

  4. how to sign in as root

reference