Stylesheet conf/userstyle.css not found, please contact the developer of "dokuwiki_2024" template.
microsoft:server:subinacl
Различия
Показаны различия между двумя версиями страницы.
microsoft:server:subinacl [2023/09/08 14:36] – создано dx | microsoft:server:subinacl [2023/09/08 14:40] (текущий) – dx | ||
---|---|---|---|
Строка 1: | Строка 1: | ||
+ | ====== SubInACL: Разрешить пользователю управлять сервисами Windows ====== | ||
+ | Появилась задача разрешить учётной записи (группа Users или Power Users) перезапускать определённую службу Windows. | ||
+ | |||
+ | Как это можно сделать [[https:// | ||
+ | * Group Policy | ||
+ | * Security Templates | ||
+ | * Консольная утилита SubInACL (сейчас этот пункт убрали, | ||
+ | |||
+ | Или же GUI вариант Service Security Editor. Это, как говорят англичане, | ||
+ | |||
+ | Последние два варианта и рассмотрим, | ||
+ | |||
+ | ===== SubInACL ===== | ||
+ | |||
+ | Описание утилиты доступно на сайте [[https:// | ||
+ | |||
+ | На [[https:// | ||
+ | |||
+ | Поэтому скачиваем с rtfm.wiki или из web archive. | ||
+ | |||
+ | ^ Файл | ||
+ | | {{ : | ||
+ | | [[https:// | ||
+ | |||
+ | Установка | ||
+ | |||
+ | <tabbox SubInACL 1> | ||
+ | {{: | ||
+ | <tabbox SubInACL 2> | ||
+ | {{: | ||
+ | <tabbox SubInACL 3> | ||
+ | {{: | ||
+ | </ | ||
+ | |||
+ | Пример. Разрешаем пользователю dx все операции (старт/ | ||
+ | |||
+ | <code batch> | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Пояснение | ||
+ | |||
+ | ^ 🔑 ^ 🔤 ^ ❓ ^ | ||
+ | | S | <wrap em> | ||
+ | | T | S <wrap em> | ||
+ | | O | ST <wrap em> | ||
+ | | P | STO <wrap em> | ||
+ | | I | STOP <wrap em> | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Информация [[https:// | ||
+ | |||
+ | Смысл **Interrogate Service** мне до конца непонятен, | ||
+ | |||
+ | Нашёл упоминание [[https:// | ||
+ | |||
+ | //Sending INTERROGATE to a service causes the service to update its status with the Service Control Manager.// | ||
+ | |||
+ | Пример вывода | ||
+ | |||
+ | <code batch> | ||
+ | sc \\rtfm-dev interrogate " | ||
+ | |||
+ | SERVICE_NAME: | ||
+ | TYPE : 10 WIN32_OWN_PROCESS | ||
+ | STATE : 4 RUNNING | ||
+ | (STOPPABLE, NOT_PAUSABLE, | ||
+ | WIN32_EXIT_CODE | ||
+ | SERVICE_EXIT_CODE | ||
+ | CHECKPOINT | ||
+ | WAIT_HINT | ||
+ | </ | ||
+ | |||
+ | Чтобы убрать права к службе используем REVOKE | ||
+ | |||
+ | <code batch> | ||
+ | |||
+ | Помимо GRANT и REVOKE есть также DENY. | ||
+ | |||
+ | Командную строку необходимо запустить от имени администратора иначе subinacl не сможет внести изменения | ||
+ | |||
+ | < | ||
+ | SeSecurityPrivilege : Access is denied. | ||
+ | |||
+ | WARNING :Unable to set SeSecurityPrivilege privilege. This privilege may be required. | ||
+ | Error OpenSCManager : Access is denied. | ||
+ | |||
+ | WARNING : / | ||
+ | </ | ||
+ | |||
+ | Рекомендую тренироваться в тестовой среде т.к. что-то сломать с помощью subinacl довольно легко. | ||
+ | |||
+ | ===== Как перезапустить сервис ===== | ||
+ | |||
+ | SC, NET, PsService, WMIC, PowerShell, GUI | ||
+ | |||
+ | 1. SC (service control) | ||
+ | |||
+ | <code batch> | ||
+ | sc start windows_exporter | ||
+ | sc stop windows_exporter | ||
+ | </ | ||
+ | |||
+ | 2. NET | ||
+ | |||
+ | Старт | ||
+ | |||
+ | <code batch> | ||
+ | C:\>net start windows_exporter | ||
+ | The Windows Exporter service is starting. | ||
+ | The Windows Exporter service was started successfully. | ||
+ | </ | ||
+ | |||
+ | Стоп | ||
+ | |||
+ | <code batch> | ||
+ | C:\>net stop windows_exporter | ||
+ | The Windows Exporter service is stopping. | ||
+ | The Windows Exporter service was stopped successfully. | ||
+ | </ | ||
+ | |||
+ | Рестарт | ||
+ | |||
+ | <code batch> | ||
+ | C:\>net stop windows_exporter && net start windows_exporter | ||
+ | The Windows Exporter service is stopping. | ||
+ | The Windows Exporter service was stopped successfully. | ||
+ | |||
+ | The Windows Exporter service is starting. | ||
+ | The Windows Exporter service was started successfully. | ||
+ | </ | ||
+ | |||
+ | 3. [[https:// | ||
+ | |||
+ | <code batch> | ||
+ | psservice \\rtfm-dev restart windows_exporter | ||
+ | </ | ||
+ | |||
+ | 4. [[https:// | ||
+ | |||
+ | <code batch> | ||
+ | wmic service windows_exporter call StartService | ||
+ | wmic service windows_exporter call StopService | ||
+ | </ | ||
+ | |||
+ | 5. [[https:// | ||
+ | |||
+ | <code batch> | ||
+ | PS C:\> Start-Service -Name windows_exporter -Verbose | ||
+ | VERBOSE: Performing the operation " | ||
+ | </ | ||
+ | |||
+ | <code batch> | ||
+ | PS C:\> Stop-Service -Name windows_exporter -Verbose | ||
+ | VERBOSE: Performing the operation " | ||
+ | </ | ||
+ | |||
+ | <code batch> | ||
+ | PS C:\> Restart-Service -Name windows_exporter -Verbose | ||
+ | VERBOSE: Performing the operation " | ||
+ | </ | ||
+ | |||
+ | 6. GUI (service.msc) | ||
+ | |||
+ | Тут всё понятно. | ||
+ | |||
+ | ===== Service Security Editor ===== | ||
+ | |||
+ | Программа доступна для свободного скачивания [[https:// | ||
+ | |||
+ | Здесь даже нечего рассказывать. Утилита работает без установки, | ||
+ | |||
+ | <tabbox ServiceEditor1> | ||
+ | {{: | ||
+ | <tabbox ServiceEditor2> | ||
+ | {{: | ||
+ | <tabbox ServiceEditor3> | ||
+ | {{: | ||
+ | </ | ||
+ | |||
+ | ===== Ссылки ===== | ||
+ | |||
+ | * https:// | ||
+ | * https:// | ||
+ | * https:// | ||
+ | * https:// | ||
+ | |||
+ | EOM | ||
+ | |||
+ | {{tag> |