This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
пакет_sudo [2020/11/25 11:05] val |
пакет_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 |
+ | |||
+ | logstash ALL=NOPASSWD: /root/cisco-backup-config-logstash.sh | ||
+ | Debian-snmp ALL=NOPASSWD: /root/cisco-backup-config.sh | ||
+ | mrtg ALL=NOPASSWD: /etc/mrtg-dhcp-stat.sh | ||
+ | |||
+ | 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 | # visudo -f /etc/sudoers.d/zabbix | ||
</code><code> | </code><code> | ||
- | zabbix ALL = (ALL) NOPASSWD: /usr/bin/nmap -O * | + | zabbix ALL = (ALL) NOPASSWD: /usr/sbin/asterisk -x * |
+ | </code><code> | ||
+ | # cat /etc/sudoers.d/openvpn1_client | ||
+ | </code><code> | ||
+ | ALL ALL=(ALL) NOPASSWD: /usr/sbin/openvpn * | ||
</code> | </code> | ||
+ | |||
+ | * Самый простой пример CI/CD [[Самый простой пример CI/CD#Шаг 5. GitLab Runner]] | ||
===== Варианты использования ===== | ===== Варианты использования ===== | ||
- | Использовать осторожно | + | Использовать ответственно |
<code> | <code> | ||
Line 33: | 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> |