nerdexam
Red_Hat

RH302 · Question #194

RH302 Question #194: Real Exam Question with Answer & Explanation

Answers: In this lab, experiment with deactivating a specific virtual console. By default, six virtual text login consoles are configured in the /etc/inittab configuration file. You'll deactivate the second of the six consoles. 1.Log in as the root user. You can do this from eith

Question

183: In this lab, you'll experiment a bit more with the /etc/inittab configuration file. 1.If you haven't already done so, create a backup for /etc/inittab. 2.Press CTRL-ALT-F2. You should see a virtual console text login screen. 3.Return to the original text console by pressing CTRL-ALT-F1 or the GUI console by pressing CTRL-ALT-F7. 4.In the /etc/inittab file, identify the lines related to the virtual login consoles. 5.Try experimenting with these lines with the mingetty commands. Add a comment character (#) in front of the second line with the mingetty command. 6.Run the init q command to make Linux reread this file. 7.Try pressing CTRL-ALT-F2 again. What happens? 8.Restore your original /etc/inittab configuration file.

Explanation

Answers: In this lab, experiment with deactivating a specific virtual console. By default, six virtual text login consoles are configured in the /etc/inittab configuration file. You'll deactivate the second of the six consoles. 1.Log in as the root user. You can do this from either the GUI or the text login interface. If you're in the GUI, open a text console. Right-click the desktop and choose New Terminal in the pop-up menu. 2.Run the cp /etc/inittab /root/inittab command. This backs up the subject configuration file in the root user's home directory. 3.Open the subject file with the vi /etc/inittab command. 4.Scroll down until you see the following line: 5:2:2345:respawn:/sbin/mingetty tty2 6.Press CTRL-ALT-F2. This should start a text login interface. You should be able to log in at the prompt with your username and password. (If you've started at a text console, you don't need to use the CTRL button.) 7.If you logged into the GUI, press CTRL-ALT-F7 to return to the GUI. If you logged into the text interface, press CTRL-ALT-F1 to return to your original screen. 8.Turn the subject command in /etc/inittab into a comment. Add a comment character in front of the line as shown: 9:#2:2345:respawn:/sbin/mingetty tty2 10.Close and save this change to /etc/inittab using the :wq command. 11.Make Linux reread /etc/inittab with the init q command. 12.Press CTRL-ALT-F2. This should start a text login interface. Try logging in again. You'll see that it's not possible. Now you can see how adding a comment character to the right line in /etc/inittab deactivates the second virtual console. 13.If you logged into the GUI, press CTRL-ALT-F7 to return to the GUI. If you logged into the text interface, press CTRL-ALT-F1 to return to your original screen. 14.Restore your original settings in the /etc/inittab file.

Community Discussion

No community discussion yet for this question.

Full RH302 Practice