Extra: Shadow Password File
Not Graded: This activity is not required and is not graded. It may have self-reflection questions, but they are there only for your own learning.
Software: Root access on a Linux machine is required for this activity. Root access on a Mac might work, but the instructor has not tested it.
In this activity you will be looking at the Linux shadow password file and seeing what happens when you create a new user.
Steps
- Run: “sudo cat /etc/shadow”
- Note that most of the entries have no passwords. These are various computer systems which have accounts on the computer for access-control reasons.
- Find your own user.
- Create a new user account on the machine and set its password to something easy.
- Find the new user in the shadow file.
- Lookup the salt code to see what algorithum your OS is using to compute the hash.
- 6, for example, is SHA256, which has a nice online SHA256 + Salt Hash Generator
- Compute the correct hash yourself using the salt string from the shadow file, the correct password, and a hash generator. The generator can be an online one or using a library in the language of your choice.
- Compare what you computed to what the system has. If they don’t match, you may need to lookup the shadow password file structure for your OS version and adjust.
- Remove the user from your system by removing the account you created.