Question

In: Computer Science

in linux operating systerm - for the file –rw—wx-rwx foo.txt use symbolic representation change the permissions...

in linux operating systerm - for the file –rw—wx-rwx foo.txt use symbolic representation change the permissions so that

a) The Owner and the group do not have any permissions. Others can open it.

b) The owner can write to it. The group can open it. Others will not have any permissions.

c) Only others have permission to open it.

d) Only the owner can open it.

Solutions

Expert Solution

In linux operating system, 'chmod' command is used to change the permissions of files according to mode. Here mode can be specified with numbers or with letters.

Permissions:
In linux system, there are three sets of permissions(--- --- ---) to any file or directory. The three sets are as follows.

User - Permissions to the owner
Group - Permissions to the group
Other - Permissions to the others.

Let us discuss about Numeric mode:
This numeric mode is in the from of one to four octal digits (0-7) and those are delivered by adding up read (4), write (2), and execute (1).


As per given the file has permissions that –rw--wxrwx

The first it represents weather it's a file or directory. Remaining 9 bits are as three sets of permissions to user(rw-), group(-wx) and others(rwx).

a) The Owner and the group do not have any permissions. Others can open it.

As per the requirement, user and group should not have any permissions and others can have only read permissions. So that for user(0+0+0), for group(0+0+0) and for others(4+0+0)

Command: chmod 004 foo.txt

b) The owner can write to it. The group can open it. Others will not have any permissions.

So that for user(0+2+0), for group(4+0+0) and for others(0+0+0).

Command: chmod 240 foo.txt

c) Only others have permission to open it.

This is same as first one.

Command: chmod 004 foo.txt


d) Only the owner can open it.

So that for user(4+0+0), for group(0+0+0) and for others(0+0+0).

Command: chmod 400 foo.txt



Related Solutions

1. When a file is created on Linux Operating System, What are the default permissions of...
1. When a file is created on Linux Operating System, What are the default permissions of the file? 2. Write a command to find the total disk space used by a specific user on linux system? 3. What is "s" permission bit in a file? 4. Explain the difference between grep and egrep? 5. Write a command to list files where third letter is x or y? 6. Write command to remove array element with id 5? 7. Write a...
Create a file and change the file permissions to (a) make it executable, (b) enable the...
Create a file and change the file permissions to (a) make it executable, (b) enable the SUID, and (c) use the ACL to add a permission for the root user. Do a long listing of this file. LINUX command line / virtual box.
[Linux permissions] Suppose that you are a superuser on a Linux system, and there is a...
[Linux permissions] Suppose that you are a superuser on a Linux system, and there is a file “/home/alice/foo”, which is owned by an ordinary user Alice. You need to give a permission to read a this file to an ordinary user Bob, but no one else (of course, you as superuser will be able to read it too). Explain how you will do it. Note: You do not have to provide specific commands, just a short description will suffice. [Limitations...
[Linux permissions] Suppose that you are a superuser on a Linux system, and there is a...
[Linux permissions] Suppose that you are a superuser on a Linux system, and there is a file “/home/alice/foo”, which is owned by an ordinary user Alice. You need to give a permission to read a this file to an ordinary user Bob, but no one else (of course, you as superuser will be able to read it too). Explain how you will do it. Note: You do not have to provide specific commands, just a short description will suffice.
Create by using Linux server • Create a file name it foo.txt • Remove all permissions...
Create by using Linux server • Create a file name it foo.txt • Remove all permissions from foo.txt • What happen if you try to read the file? • Change foo.txt permission to read and write only for owner • Change foo.txt permission to read for group • Change foo.txt permission to read and write everyone
USING COMMAND PROMPT ON LINUX. show how... Linux Users, Groups, and Permissions Lab Objective: Understand how...
USING COMMAND PROMPT ON LINUX. show how... Linux Users, Groups, and Permissions Lab Objective: Understand how to create user accounts Understand how to create group accounts Creating good password policies Understanding permissions and file sharing Setup: You will need a Ubuntu Server VM Walk Through: You are a system administrator who has been tasked to create user accounts for new users on your system. You can pick whatever theme you like as long as there are protagonist and antagonist users:...
File permissions let us control who can: a. change how files are executed only b. create...
File permissions let us control who can: a. change how files are executed only b. create files only c. delete files only d. read, write, and execute a file
Linux Directories, File Properties, and the File System in C Understanding Unix/Linux Programming Your version of...
Linux Directories, File Properties, and the File System in C Understanding Unix/Linux Programming Your version of mv command The mv command is more than just a wrapper around the rename system call. Write a version of mv that accepts two argument. The first argument must be the name of a file, and the second argument may be the name of a file or the name of a directory. If the destination is the name of a directory, then mv moves...
Linux Ubuntu 1. Use the appropriate commands to locate the device file used by the device,...
Linux Ubuntu 1. Use the appropriate commands to locate the device file used by the device, mount the filesystem to a directory of your choice, and check the filesystem for errors. 2. Finally, add a line to /etc/fstab to ensure that the filesystem can be easily mounted in the future (this line should not automount the filesystem at boot time). You have to document all your steps and provide the screenshot of your work process.
IN C PROGRAMMING LINUX how to use makefile to include .a static library and .h file...
IN C PROGRAMMING LINUX how to use makefile to include .a static library and .h file from another directory in C? I have a header file myheader.h and a static library libmylib.a file in directory1. In directory2, I'm writing a program which uses them. Suppose I have main.c in directory2 which uses myheader.h and libmylib.a. How do I create a Makefile to compile and link them? LIBB = -L/../directory1/libmylib.a HEADER = -L/../directory1/myheader.h main: main.o gcc $(HEADER) $(LIBB) main.o: main.c gcc...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT