๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

TIL

Mac User & Group, Permission ๊ด€๋ จ ๋ช…๋ น์–ด ๋ชจ์œผ๋Š”์ค‘

XAMPP๋ฅผ ์‚ฌ์šฉํ•ด์„œ ๋กœ์ปฌ ๊ฐœ๋ฐœ ํ™˜๊ฒฝ ์ž‘์—… ์ค‘์ด๋ผ apache ์›น์„œ๋ฒ„ ์„ค์ •์„ ๋ณด๋Š” ์ค‘์ธ๋ฐ ๊ณ„์† Permission ๊ด€๋ จ ์—๋Ÿฌ๊ฐ€ ๋– ์„œ Users & Group ๊ด€๋ จ ๋ช…๋ น์–ด๋ฅผ ์—„์ฒญ ๊ฒ€์ƒ‰ํ•˜๋Š” ์ค‘์ด๋‹ค. ์‚ฌ์šฉํ•˜๋Š” ๋Œ€๋กœ ๊ธฐ๋กํ•ด๋†“์œผ๋ ค๊ณ  ํ•œ๋‹ค. 

๊ฐ ๋ช…๋ น์–ด๊ฐ€ ๋ฌด์—‡์„ ์˜๋ฏธํ•˜๋Š”์ง€ ์ž์„ธํžˆ ์ž‘์„ฑํ•˜๋Š” ๊ฒƒ์€ ๋’ค๋กœ ๋ฏธ๋ค„๋‘”๋‹ค. 

# ํ˜„์žฌ ์œ ์ €
whoami

# ์œ ์ € ๋ชฉ๋ก
dscl . -ls /Users

# ๊ทธ๋ฃน ๋ชฉ๋ก
dscl . -ls /groups

# ํŠน์ • ์œ ์ €์— ๋Œ€ํ•œ ์ •๋ณด
dscl . -read /Users/<์œ ์ €๋ช…>

# ํŠน์ • ๊ทธ๋ฃน์— ๋Œ€ํ•œ ์ •๋ณด
dscl . -read /Groups/<๊ทธ๋ฃน๋ช…>

# ํŠน์ • ๊ทธ๋ฃน์— ์–ด๋–ค ์œ ์ €๊ฐ€ ์†ํ•ด์žˆ๋Š”์ง€ ํ™•์ธ
dscacheutil -q group -a name <๊ทธ๋ฃน๋ช…>

# ํŠน์ • ์œ ์ €๊ฐ€ ์–ด๋–ค ๊ทธ๋ฃน์— ์†ํ•ด์žˆ๋Š”์ง€ ํ™•์ธ
id -nG <์œ ์ €๋ช…>

# ํŠน์ • ๊ฒฝ๋กœ owner ๋ณ€๊ฒฝํ•˜๊ธฐ
chown <์œ ์ €๋ช…/์œ ์ €์•„์ด๋””>:<๊ทธ๋ฃน๋ช…/๊ทธ๋ฃน์•„์ด๋””> ๋ณ€๊ฒฝ/ํ•˜๊ณ ์ž/ํ•˜๋Š”/๊ฒฝ๋กœ
# ํŠน์ • ๊ฒฝ๋กœ owner ๋ณ€๊ฒฝํ•˜๊ธฐ ํ•˜์œ„ ํ•ญ๋ชฉ๋“ค์— ๋Œ€ํ•ด์„œ ๋ชจ๋‘ ๋ณ€๊ฒฝํ•˜๊ณ ์ž ํ•˜๋Š” ๊ฒฝ์šฐ 
chown -R <์œ ์ €๋ช…/์œ ์ €์•„์ด๋””>:<๊ทธ๋ฃน๋ช…/๊ทธ๋ฃน์•„์ด๋””> ๋ณ€๊ฒฝ/ํ•˜๊ณ ์ž/ํ•˜๋Š”/๊ฒฝ๋กœ
# ์˜ˆ์‹œ
chown user:staff /var/www
chown -R user:staff /var/www

 

์—๋Ÿฌ๋ฅผ ํ•ด๊ฒฐํ–ˆ๋‹ค.

๊ถŒํ•œ ๋ฌธ์ œ์ด๊ธฐ๋„ ํ–ˆ์ง€๋งŒ ๊ฒฝ๋กœ๊ฐ€ ์ž˜๋ชป๋˜์–ด ์žˆ์–ด์„œ ๋œจ๋Š” ์—๋Ÿฌ์˜€๋‹ค...... ํ›„์šฐ.. 
์•„๋ฌดํŠผ ํฅ๋ฏธ๋กญ๊ธฐ๋„ ํ–ˆ๊ณ  ์•Œ์•„๋‘๋ฉด ์ข‹์€ ๋‚ด์šฉ์ด๋‹ˆ ํ—˜ํ—˜

 

์ถœ์ฒ˜: StackOverflow ์—ฌ๊ธฐ์ €๊ธฐ

์ฐธ๊ณ :

https://www.macinstruct.com/tutorials/how-to-set-file-permissions-on-a-mac/

 

How to Set File Permissions on a Mac | Macinstruct

Your Mac uses permissions to restrict access to applications, files, and folders. Utilizing this security control can help protect your data from unauthorized access. Whether you use your Mac in public places or share it with other users, you may want to c

www.macinstruct.com