This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
пакет_sudo [2020/03/04 13:48] val [Debian/Ubuntu] |
пакет_sudo [2024/09/09 05:27] (current) val [Debian/Ubuntu] |
||
---|---|---|---|
Line 10: | Line 10: | ||
%sudo ALL=(ALL) ALL | %sudo ALL=(ALL) ALL | ||
- | #%sudo ALL=(ALL) NOPASSWD: ALL | + | #%sudo ALL=(ALL) NOPASSWD: ALL |
- | backup ALL = NOPASSWD: /bin/tar -cjf - etc/ | + | student ALL=NOPASSWD:/usr/bin/rsync |
- | www-data ALL = NOPASSWD: /usr/sbin/asterisk -x * | + | www-data ALL=NOPASSWD: /usr/sbin/asterisk -x * |
- | asterisk ALL = NOPASSWD: /sbin/init 6 | + | asterisk ALL=NOPASSWD: /sbin/init 6 |
- | </code> | + | |
- | ===== FreeBSD ===== | + | logstash ALL=NOPASSWD: /root/cisco-backup-config-logstash.sh |
- | <code> | + | Debian-snmp ALL=NOPASSWD: /root/cisco-backup-config.sh |
- | # pkg install sudo | + | mrtg ALL=NOPASSWD: /etc/mrtg-dhcp-stat.sh |
- | # visudo | + | gitlab-runner ALL=NOPASSWD: /usr/bin/make install |
+ | jenkins ALL=NOPASSWD: /usr/bin/make install | ||
</code><code> | </code><code> | ||
- | ... | + | # visudo -f /etc/sudoers.d/zabbix |
- | %wheel ALL = (ALL) ALL | + | </code><code> |
- | + | zabbix ALL = (ALL) NOPASSWD: /usr/sbin/asterisk -x * | |
- | backup ALL = NOPASSWD: /usr/bin/tar -cjf - etc/ | + | </code><code> |
- | + | # cat /etc/sudoers.d/openvpn1_client | |
- | www ALL = NOPASSWD: /usr/local/sbin/asterisk -x * | + | </code><code> |
+ | ALL ALL=(ALL) NOPASSWD: /usr/sbin/openvpn * | ||
</code> | </code> | ||
+ | |||
+ | * Самый простой пример CI/CD [[Самый простой пример CI/CD#Шаг 5. GitLab Runner]] | ||
===== Варианты использования ===== | ===== Варианты использования ===== | ||
- | Не надо использовать | + | Использовать ответственно |
<code> | <code> | ||
Line 43: | Line 46: | ||
<code> | <code> | ||
# sudo -u asterisk bash | # sudo -u asterisk bash | ||
+ | |||
+ | $ cd | ||
+ | </code> | ||
+ | Запуск "сложных" команд (с конвейерами) с повышенными привилегиями | ||
+ | <code> | ||
+ | $ sudo sh -c 'tail -n1 /etc/shadow | cat > /ttt' | ||
</code> | </code> |