Experimental Purpose: To understand the Linux file format with permission settings
Experiment steps:
1. Log in as root into Linux
2. Create a new account using the following command Anyuser/usr/sbin/useradd Anyuser
3. Set password for Anyuser account:
/usr/sbin/passwd
Changing password for user anyuser
New UN IX Password
Retype UNIX Password
4. Log off and login with Anyuser account
5. View the contents of the Linux password file:/bin/cat/etc/passwd
Root:x:0:0:root:/bin/bash
Bin:x:1:1:bin:/bin
Daemon:x:2:2:daemon:/sbin:
Mail:x:8:12:mail:/var/spool/mail
Named:x "25:25:bind user:/var/named:
Dnscache:x:410:405:dnscache User:/var/djbdns:/bin/true
Xfs:x:414:414:x Font Server:/etc/s11/fs:/bin/false
Postfix:x:415:416:postfix:/var/spool/postrix:
Mtsql:x:416:417mysql Server:/var/lib/mysql:/bin/bash
Test:x:501:501:condor:/home/condor:/bin/bash
Anyuser:x:502:506:zhengya:/home/julia:/bin/bash
6. Logout and log in as root
7. Enter the following command:/bin/chmod o-r/etc/
chmod is the command to make a file or directory permission under Linux, and we'll introduce it in the operating system Security section for details.
8. Re-log on again with the Anyuser account, trying to list all the content under/etc/
9. Because the system no longer allows everyone access, the command should fail
10. As a non-root user, you can use the following command to make your fortune password:
host$ passwd
(current) UNIX Password:
New UNIX Password:
Retype new UNIX Password:
Passwd:all Authentication Tokens updated successfully