This set of Unix online test focuses on “Administrator Specific Commands and Privileges – 2”.
1. The SUID for any file can be set by the administrator using ____
b) chmod u+s filename
c) chmod s filename
d) chmod us filename
Explanation: The SUID (set-user-ID) lets a process have the privileges of the owner of the file during the instance of the program. The SUID for any file can be set by the administrator using chmod command. For example,
# chod u+s filename.
2. The superuser can set the sticky bit.
Explanation: The sticky bit (also called the saved text bit) when applied to a regular file ensures that the text image of the program with the bit set is permanently kept in the swap area. The sticky bit also comes with a security feature when applied to directories. To apply the sticky bit to a directory superuser can use 1 as the additional bit with chmod in the following manner:
# chmod 1775 dirone # ls -l a.txt drwxrwxr-t 2 abd dialin 2048 Apr 23 09:04 Dirone
3. Which of the following commands are used for the maintenance of user accounts?
d) useradd, usermod, userdel
Explanation: For the creation and maintenance of user accounts, UNIX provides to the superuser three commands —useradd, usermod and userdel.
4. _____ command is used for creating a new group.
Explanation: groupadd command allows us to create a new group. For example, to create a group named OFFICEMANAG with a GID (group ID) of 398, use the following command:
groupadd -g 398 OFFICEMANAG
5. For adding a new user to the system, we have to use ____ command.
Explanation: The useradd command is used to add new users to the system. Before using this command the super user should provide all the parameters related to the user in the command line itself. For example,
# useradd -u 134 -g OFFICEMANAG -c “The RDMS” -d /home/group -s /bin/bash -m group
6. All the user information is stored in _____
Explanation: All the user information except the password encryption is stored in /etc/passwd. The encryption itself is stored in /etc/shadow. There are seven fields in /etc/passwd.
7. Which of the following is not a field stored in /etc/passwd?
c) UID, GID
d) encrypted password
Explanation: The password encryption itself is stored in /etc/shadow while there are seven fields in /etc/passwd namely:
• HOME directory
• Login shell
8. Which command is used by the administrator to modify some parameters of existing users?
Explanation: usermod command is used for modifying some parameters set with useradd. For example, sometimes users need to change their login shell, to do so root user will invoke the following command:
# usermod -s /bin/bash oracle //sets bash as the login shell for user oracle
9. userdel is used for removing users from the system.
Explanation: We can remove users from the system using the userdel command. To remove a particular user from the system, use the following command:
# userdel oracle // remove user amed oracle from system but doesn’t delete his files
10. shutdown command is used by the administrator for shutting down the system.
Explanation: The system administrator is also responsible for shutting down the system. For this purpose, shutdown command is used. This command performs various activities before shutting the system.
11. Which option is used with shutdown command to override the default waiting time?
Explanation: -g option is used with shutdown command to override the default waiting time (one minute). For example,
shutdown -g2 // shut down the machine after 2 minutes
12. Which one of the following command will shutdown and reboot the system?
a) shutdown -g2
b) shutdown -g2 i6
c) shutdown -g2 -g0
d) shutdown -y -g0 -i6
Explanation: -y option is used with shutdown command for shutting the system immediately. Similarly, we can use the shutdown command to turn the machine off in various ways. To shut down and reboot the system, use the following command:
shutdown -y -g0 -i6.
13. Which command is used for reporting free space on the disk?
Explanation: As we know that, UNIX OS is supported by various multiple file systems. The df (disk free) command reports the amount of space available for each file system separately.
14. ___ option is used with df command for displaying the total amount of disk space in the file system.
Explanation: The -t (total) option when used with df command displays free space on each file system as well as the total amount of disk space in the file system.
15. ___ option is used with df command for displaying the total amount of disk space in the file system in terms of Kilobytes.
Explanation: The df (disk free) command reports the amount of space available for each file system separately. -k option is used with df command for displaying the total amount of disk space in the file system in terms of Kilobytes.
Sanfoundry Global Education & Learning Series – Unix.
To practice all areas of Unix for online tests, here is complete set of 1000+ Multiple Choice Questions and Answers.