• Granting Ownership to an Individual User
  • L in u X ba sics for h acke rs g e t t I n g s t a r t e d w I t h




    Download 7,3 Mb.
    Pdf ko'rish
    bet60/115
    Sana27.11.2023
    Hajmi7,3 Mb.
    #106243
    1   ...   56   57   58   59   60   61   62   63   ...   115
    Bog'liq
    linuxbasicsforhackers

    Granting Permissions
    Each and every file must be allocated a particular level of permission 
    for the different identities using it. The three levels of permission are as 
    follows:
    r
    Permission to read. This grants permission only to open and view 
    a file.
    w
    Permission to write. This allows users to view and edit a file.
    x
    Permission to execute. This allows users to execute a file (but not 
    necessarily view or edit it).
    In this way, the root user can grant users a level of permission depend-
    ing on what they need the files for. When a file is created, typically the user 
    who created it is the owner of the file, and the owning group is the user’s 
    current group. The owner of the file can grant various access privileges to 
    it. Let’s look at how to change permissions to pass ownership to individual 
    users and to groups.
    Granting Ownership to an Individual User
    To move ownership of a file to a different user so that they have the ability 
    to control permissions, we can use the 
    chown
    (or change owner) command:
    kali >chown 
    u
    bob 
    v
    /tmp/bobsfile
    Here, we give the command, the name of the user we are giving owner-
    ship to, and then the location and name of the relevant file. This command 
    grants the user account for Bob u ownership of bobsfile v.


    Controlling File and Directory Permissions
    51
    Granting Ownership to a Group
    To transfer ownership of a file from one group to another, we can use the 
    chgrp
    (or change group) command.
    Hackers are often more likely to work alone than in groups, but it’s not 
    unheard of for several hackers or pentesters work together on a project, and 
    in that case, using groups is necessary. For instance, you might have a group 
    of pentesters and a group of security team members working on the same 
    project. The pentesters in this example are the root group, meaning they 
    have all permissions and access. The root group needs access to the hack-
    ing tools, whereas the security folk only need access to defensive tools such 
    as an intrusion detection system (IDS). Let’s say the root group downloads 
    and installs a program named newIDS; the root group will need to change 
    the ownership to the security group so the security group can use it at will. 
    To do so, the root group would simply enter the following command:
    kali >chgrp 
    u

    Download 7,3 Mb.
    1   ...   56   57   58   59   60   61   62   63   ...   115




    Download 7,3 Mb.
    Pdf ko'rish

    Bosh sahifa
    Aloqalar

        Bosh sahifa



    L in u X ba sics for h acke rs g e t t I n g s t a r t e d w I t h

    Download 7,3 Mb.
    Pdf ko'rish