📄 userlist.sh
字号:
#!/bin/bash# userlist.shPASSWORD_FILE=/etc/passwdn=1 # User numberfor name in $(awk 'BEGIN{FS=":"}{print $1}' < "$PASSWORD_FILE" )# Field separator = : ^^^^^^# Print first field ^^^^^^^^# Get input from password file ^^^^^^^^^^^^^^^^^do echo "USER #$n = $name" let "n += 1"done # USER #1 = root# USER #2 = bin# USER #3 = daemon# ...# USER #30 = bozoexit 0# Exercise:# --------# How is it that an ordinary user (or a script run by same)#+ can read /etc/passwd?# Isn't this a security hole? Why or why not?
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -