setcap.md 886 B

setcap

์ง€์ •๋œ ํŒŒ์ผ์˜ ๊ถŒํ•œ ์„ค์ •. ๊ฐ™์ด ๋ณด๊ธฐ: getcap. ๋” ๋งŽ์€ ์ •๋ณด: https://manned.org/setcap.

  • ์ฃผ์–ด์ง„ ํŒŒ์ผ์— cap_net_raw ๊ถŒํ•œ ์„ค์ • (RAW ๋ฐ PACKET ์†Œ์ผ“ ์‚ฌ์šฉ์„ ์œ„ํ•ด):

setcap '{{cap_net_raw}}' {{๊ฒฝ๋กœ/๋Œ€์ƒ/ํŒŒ์ผ}}

  • ํŒŒ์ผ์— ์—ฌ๋Ÿฌ ๊ถŒํ•œ ์„ค์ • (ep๋Š” "ํšจ๊ณผ์  ํ—ˆ๊ฐ€"๋ฅผ ์˜๋ฏธ):

setcap '{{cap_dac_read_search,cap_sys_tty_config+ep}}' {{๊ฒฝ๋กœ/๋Œ€์ƒ/ํŒŒ์ผ}}

  • ํŒŒ์ผ์—์„œ ๋ชจ๋“  ๊ถŒํ•œ ์ œ๊ฑฐ:

setcap -r {{๊ฒฝ๋กœ/๋Œ€์ƒ/ํŒŒ์ผ}}

  • ์ง€์ •๋œ ํŒŒ์ผ์— ํ˜„์žฌ ์ง€์ •๋œ ๊ถŒํ•œ์ด ์—ฐ๊ด€๋˜์–ด ์žˆ๋Š”์ง€ ํ™•์ธ:

setcap -v '{{cap_net_raw}}' {{๊ฒฝ๋กœ/๋Œ€์ƒ/ํŒŒ์ผ}}

  • ์„ ํƒ์  -n root_uid ์ธ์ˆ˜๋Š” ์ด ๋ฃจํŠธ ์‚ฌ์šฉ์ž ID ์†Œ์œ ์ž์™€ ํ•จ๊ป˜ ์‚ฌ์šฉ์ž ๋„ค์ž„์ŠคํŽ˜์ด์Šค์—์„œ๋งŒ ํŒŒ์ผ ๊ถŒํ•œ์„ ์„ค์ •ํ•˜๋Š” ๋ฐ ์‚ฌ์šฉ๋  ์ˆ˜ ์žˆ์Œ:

setcap -n {{root_uid}} '{{cap_net_admin}}' {{๊ฒฝ๋กœ/๋Œ€์ƒ/ํŒŒ์ผ}}