Question

UNIX File Permission help, please answer the questions in the green boxes. Thank you

Lab 03 File Permissions In this lab we will: learn about file permissions learn to create symbolic links and hard links Utilities that will be utilized in this Lab: us, cd, less, cat touch, chmod id umask, mkdir, In, echo and redirection Users and Groups Linux supports several methods of controlling access to files an directories. In this lab we are going to learn the traditional access control model that is based on the concepts of file ownership and permissions. In this model, access is granted based on the concepts of users and groups. A user is an individual access account, and they can belong to one or more groups, and they can own files. When user accounts are created, they are assigned a username and a user id (or uic), and also a primary group which defaults to the same as the user id To find out your uid and the groups that your account is associated with, use the id command j mora@blue ne id uid 1234 (jmora) gid 1234 (jmora) groups 1234 mora) User account information is stored in the /etc/passwd file. Each line on this file corresponds to a user record, which contains 7 fields separated by a colon username: the name used to login into the system. It should be between 1 to 32 charcters long password: a value of x indicates the account has an encrypted password stored in /etc/shadow user ID (UID): user identification number. By default UID 0 is reserved for root user and UIDs ranging from 1-99 are reserved for other predefined accounts. Further UIDs ranging from 100-999 are reserved for system accounts and groups group ID (GID): primary group ID. user info: This field is optional and allow you to define extra information about the user. Tipically contains the accounts full name. home directory: The absolute path of the users home directory. shell: The absolute path of the users default shell. Users and Groups 1. What is your user id? To which groups is your account associated? passwd file with the command less /etc/password, and locate the apache account (Hint: use the search feature of Less to find your account). What are 2. Open the the apache accounts uid and home directory? 3. Open the Vetc/group file. How many users are associated with the apache group?

chmod 1. Change directory to your home. Run the command umask 077. Create an empty file called newfile What are the permissions of this file? 2. Complete the following table by providing the chmod command that will make the file transition through the permissions indicated in the column Attributes, or by providing the Attributes that would result from running the chmod command if specified. This means that the comands are run sequentially (i.e. for row n you need to call chmod so the file transtions from the attributes in row n-1 to the attributes in row n). Attributes Notation chmod command symbolic octal r-X symbolic octal chmod 755 newfile symbolic rwxrw octal symbolic chmod ug+w, o r newfile Note In the next section of lab we are going to be modifying file permissions, and the best way to verify if these work is by having another user that can help you validate your settings. It is highly recommended to work with the person beside you permissions in practice Run the command umask 077 Make sure your home directory has execute access enabled for group and other. You can verify this by running the ls -ld command: [you@blue yourhome]$ us -1d n drwx x 7 you you 4096 Feb 2 09:04 /home/student/you

0 0
Add a comment Improve this question Transcribed image text
Answer #1

As per Chegg policy i can give you answers for first two green boxes.

Box 1 Answers:

1) use "id" command

syntax: id <username>

It will show your userid and to which groups this "user id" is associated with.

2) less /etc/passwd

after issuing this command, in the prompted screen give "/<search_pattern>" and type "n" . It will show you the matched pattern and take to the next match

3) open /etc/group using "vi".

vi /etc/group

now run the following command

:!cat %|grep -c "pattern"

Box 2 answers:

1)

$cd ~ //Change to your home directory

$umask 077

$cat >newfile

some text

^D

$ls -l newfile

-rw------- 1 naresh naresh 5 Feb 12 02:26 newfile

2)


numeral values of read(r)/write(w)/execute(x)
r=4
w=2
x=1

-rwx------- : chmod u=rw,g=0,o=0 <file/directory>

-r-x------: chmod 500 <file/directory>

-rwxr--r--: chmod u=rwx,g=r,o=r <file/directory>

-rwxrw----: chmod u=rwx,g=rw,o=0 <file/directory>

-r-xr--r-x: chmod 545 <file/directory>

Add a comment
Know the answer?
Add Answer to:
UNIX File Permission help, please answer the questions in the green boxes. Thank you Lab 03...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Operating System Lab (CE 351) Lab 6: Users and groups Help: study the file /etc/passwd (page...

    Operating System Lab (CE 351) Lab 6: Users and groups Help: study the file /etc/passwd (page 19 from the notes) Helping commands: useradd passwd userdel groupadd cut grep su Lab exercises: 1. Implement the following tasks: a. Copy the contents of /etc/passwd file separated by space into new.txt file b.Delete a user whose ID is > 1000 ( hint: use shell scripting and the file /etc/passwd)

  • Step 3: How would you write this script in C? It needs to do the things...

    Step 3: How would you write this script in C? It needs to do the things required in step 3. 1. You have received a new batch of distinguished users; their basic information is located in newusers.tar. Inside of the tar file, there is a file called "newusers.txt" which contains a colon-separated entry for each user: the username, the uid, the GECOS information, and the user's preferred shell. Also in the tar file you will find a public key for...

  • Cybersecurity Fundamentals Lab #9: Access ControlName: ____________________ If your Kali VM is already up and running,...

    Cybersecurity Fundamentals Lab #9: Access ControlName: ____________________ If your Kali VM is already up and running, login to the root account on the VM via ssh. It does not matter whether you use a command line or GUI sshclient. If your VM is not currently up, use the vSphere web client to start your VM before logging into it via ssh.1: Create an Unprivileged User For some labs, including this one, we will need a non-root user account on the...

  • These questions involve the linux operating system. Please complete the questions that you can. Thanks Question...

    These questions involve the linux operating system. Please complete the questions that you can. Thanks Question 21 (2 points) In the lab, you used the parameter in conjunction with the su command (for example, su -johndoc). It is used to provide an enviranment similar to what the user would expect had the user logged in directly Access the Linux man pages for the su command and provide the definition for the-parameter Question 22 (1 point) Provide the command used to...

  • //Need help ASAP in c++ please. Appreciate it! Thank you!! //This is the current code I have. #include <iostream> #include <sstream> #include <iomanip> using namespace std; cl...

    //Need help ASAP in c++ please. Appreciate it! Thank you!! //This is the current code I have. #include <iostream> #include <sstream> #include <iomanip> using namespace std; class googlePlayApp { private: string name; double rating; int numInstalls; int numReviews; double price;    public: googlePlayApp(string, double, int, int, double); ~ googlePlayApp(); googlePlayApp();    string getName(); double getRating(); int getNumInstalls(); int getNumReviews(); string getPrice();    void setName(string); void setRating(double); void setNumInstalls(int); void setNumReviews(int); void setPrice(double); }; googlePlayApp::googlePlayApp(string n, double r, int ni, int nr, double pr)...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT