Portál AbcLinuxu, 12. května 2025 18:35
Dobry den, neni mi jasne nastavovani SUID bitu, pro priklad:
[user@NB a]$ whoami user [user@NB a]$ ls -l total 544 -rwxrwxrwx 1 root root 549188 2008-12-27 20:43 bash [user@NB a]$ ./bash [user@NB a]$ exit [user@NB a]$ sudo chmod 4777 bash [user@NB a]$ ls -l total 544 -rwsrwxrwx 1 root root 549188 2008-12-27 20:43 bash [user@NB a]$ ./bash bash-3.2$ whoami user bash-3.2$ exit
Jsem tedy uzivatel user a ve slozce mam kopii programu bash, ktera je vlastnena rootem. bash spustim, prompt je stale stejny a stiskem CTRL+D se zase odhlasim. Pote souboru nastavim suid bit a soubor znovu spustim. Zmenil se prompt (nevite proc?) ale stale jsem uzivatel user a nemam rootovska prava. Muzete mi to prosim nekdo objasnit?
Jinak více v manuálové stránce Bashe:
-p Turn on privileged mode. In this mode, the $ENV and $BASH_ENV files are not processed, shell functions are not inherited from the environment, and the SHELLOPTS variable, if it appears in the environment, is ignored. If the shell is started with the effective user (group) id not equal to the real user (group) id, and the -p option is not supplied, these actions are taken and the effective user id is set to the real user id. If the -p option is supplied at startup, the effective user id is not reset. Turning this option off causes the effective user and group ids to be set to the real user and group ids.
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.