RPC in Red Hat Linux
Question: How does a kernel identify users on a host ?
The kernel identifies users on a host by looking at the /etc/passwd file. This file contains a list of all the users on the system, along with their usernames, passwords, and home directories. When a user logs in, the kernel checks the /etc/passwd file to verify the user's credentials. If the user is authenticated, the kernel then opens the user's home directory and sends a request for the directory contents.
The kernel sends a request for the directory contents by using the stat() system call. The stat() system call takes a file name as its argument and returns information about the file, such as its size, permissions, and modification time. The kernel uses this information to determine whether the user has permission to read the directory contents. If the user does have permission, the kernel then opens the directory and sends a request for the list of files in the directory.
The kernel receives the list of files in the directory by using the opendir() system call. The opendir() system call takes a directory name as its argument and returns a pointer to a directory handle. The kernel then uses this directory handle to iterate through the directory and read the names of the files in the directory.
The kernel can then access the contents of the files in the directory by using the readdir() system call. The readdir() system call takes a directory handle as its argument and returns a pointer to a directory entry. The directory entry contains information about the file, such as its name, size, and permissions. The kernel can then use this information to open the file and read its contents.