Question

In: Computer Science

C/C++ Programming in a UNIX Environment, You should have read permission for the/etc/passwdfile. To answer the...

C/C++ Programming in a UNIX Environment,

You should have read permission for the/etc/passwdfile. To answer the following questions, usecatorlessto display/etc/passwd. Look at the fields of information in/etc/passwdfor the users on the local system.

a.Which character is used to separate fields in/etc/passwd?

b.How many fields are used to describe each user?

c.How many users are on the local system?

d.How many different login shells are in use on your system? (Hint:Look at the last field.)

e.The second field of/etc/passwdstores user passwords in encoded form. If the password field contains anx, your system uses shadow passwords and stores the encoded passwords elsewhere. Does your system use shadow passwords?

Solutions

Expert Solution

a. Which character is used to separate fields in /etc/passwd?
Ans: The special character "colon (:)" is used to separate fields in etc/password

b. How many fields are used to describe each user?
Ans: There are 'seven' fields to describe each user.
i.e name, password, user Id, group Id, Full name of the user, home-directory and shell

c. How many users are on the local system?
Ans: There is no fix number of users present in a system .it is actually system dependentd.
to get all the user list you can use below command
$less /etc/passwd
to get the count
$getent passwd | wc -l
for me it is giving 34 users

d.How many different login shells are in use on your system? (Hint: Look at the last field.)
Ans:it is also system dependente.

The second field of /etc/passwd stores user passwords in encoded form. If the password field contains an x,
your system uses shadow passwords and stores the encoded passwords elsewhere. Does your system use shadow passwords?
Ans: system dependent


Related Solutions

a) b) c) Compare and contrast systems programming in Windows as against systems programming in Unix/Linux....
a) b) c) Compare and contrast systems programming in Windows as against systems programming in Unix/Linux. CR, 8 Explain the term structured exception handling (SEH) as used in systems programming and give a practical example of how it can be used to handle errors in a block of code. AP, 7 Write a C/C++ system program to delete an unwanted file in the Windows file system. Compile and run the program and copy the source code into your answer booklet....
PLEASE ANSWER ONLY IF YOU KNOW subject is Unix System programming Create a SQLite Replit(or SQLite...
PLEASE ANSWER ONLY IF YOU KNOW subject is Unix System programming Create a SQLite Replit(or SQLite on another coding platform) that creates a table representing students in a class, including   name, graduation year, major, and GPA. Include two queries searching this student data in different ways, for example searching for all students with graduation year of 2021, or all students with GPA above a certain number.
Programming Projects Project 1—UNIX Shell This project consists of designing a C program to serve as...
Programming Projects Project 1—UNIX Shell This project consists of designing a C program to serve as a shell interface that accepts user commands and then executes each command in a separate process. Your implementation will support input and output redirection, as well as pipes as a form of IPC between a pair of commands. Completing this project will involve using the UNIX fork(), exec(), wait(), dup2(), and pipe() system calls and can be completed on any Linux, UNIX, or macOS...
C programming, if you already answer this, please skip, thanks fill in ... /* In this...
C programming, if you already answer this, please skip, thanks fill in ... /* In this program, read stdin a line at a time, and print the longest line. If that line is longer than 30 characters, print it in the format first ten characters...middle ten characters...last ten characters. Note: The longest line can be quite long. */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdbool.h> #define BLOCKSIZE 100 char* readline() {    char* result = NULL;    int rsize;...
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...
Programming in C (not C++) ## Requirements Only need to edit the challenge.c You have one...
Programming in C (not C++) ## Requirements Only need to edit the challenge.c You have one function to implement: void fork_exec(char** argv): This takes in an array of strings representing arguments. The first argument is the filename of an executable (which will be given as a relative filepath, such as "./a") The remaining terms would be arguments for said executable. The array is null terminated You need to fork your process. The child needs to call exec (rather, a variant...
Implement the MSI cache coherence protocol in your favorite programming language (C, C++, Java, python, etc.)....
Implement the MSI cache coherence protocol in your favorite programming language (C, C++, Java, python, etc.). Wikipedia has a nice high level description of the protocol. Consider only one level of cache which is a write back cache. Moreover, assume that there are 4 processing cores working on a single shared memory. To simplify, assume that you are writing the code for only one block of cache and that block can hold 4 different memory locations.
C++ programming language. Write a program that will read in id numbers and place them in...
C++ programming language. Write a program that will read in id numbers and place them in an array.The array is dynamically allocated large enough to hold the number of id numbers given by the user. The program will then input an id and call a function to search for that id in the array. It will print whether the id is in the array or not. Sample Run: Please input the number of id numbers to be read 4 Please...
The Programming Language is C++ PLEASE, Make sure to read the requirements and grading criteria for...
The Programming Language is C++ PLEASE, Make sure to read the requirements and grading criteria for homework first... Thank you!!! Objective: The purpose of this project is to expose you to: One-dimensional parallel arrays, input/output, Manipulating summation, maintenance of array elements. In addition, defining an array type and passing arrays and array elements to functions. Problem Specification: Using the structured chart below, write a program to keep records and print statistical analysis for a class of students. There are three...
C Programming file.c takes in one input argument that denotes a file to be read. It...
C Programming file.c takes in one input argument that denotes a file to be read. It needs to convert the contents of that file into a character array (char *) and then into a an unsigned character array (unsigned char *). Please fix and or complete the program, and explain any of the changes too: ---- #include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char *argv[]) { FILE *f; f = fopen(argv[1], "r"); if( !f ) { exit(1); }...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT