If you wanted to edit /etc/passwd, /etc/shadow, /etc/group, and /etc/gshadow safely, which sequence of commands would you run respectively?

Study for the OSCP Linux Exam. Use our flashcards and multiple-choice questions to test your skills. Each query comes with detailed hints and explanations to enhance your preparedness. Get ready to conquer the exam!

Multiple Choice

If you wanted to edit /etc/passwd, /etc/shadow, /etc/group, and /etc/gshadow safely, which sequence of commands would you run respectively?

Explanation:
Editing these critical authentication files must be done with the system’s safe, locked editing tools. vipw opens the password file in a protected environment, ensuring the file isn’t corrupted by partial writes. When you need to modify the shadow data, vipw -s edits the shadow file in the same safe way, targeting the correct file. For the group database, vigr provides a safe editing session for /etc/group, and vigr -s does the same for the gshadow file. Using the appropriate tool for each file, and the -s option to reach the corresponding shadow or gshadow file, keeps the edits atomic and properly formatted. This sequence—vipw for passwd, vipw -s for shadow, vigr for group, and vigr -s for gshadow—ensures you modify the right files safely.

Editing these critical authentication files must be done with the system’s safe, locked editing tools. vipw opens the password file in a protected environment, ensuring the file isn’t corrupted by partial writes. When you need to modify the shadow data, vipw -s edits the shadow file in the same safe way, targeting the correct file. For the group database, vigr provides a safe editing session for /etc/group, and vigr -s does the same for the gshadow file. Using the appropriate tool for each file, and the -s option to reach the corresponding shadow or gshadow file, keeps the edits atomic and properly formatted. This sequence—vipw for passwd, vipw -s for shadow, vigr for group, and vigr -s for gshadow—ensures you modify the right files safely.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy