{"id":4290,"date":"2025-08-19T15:47:29","date_gmt":"2025-08-19T12:47:29","guid":{"rendered":"https:\/\/cloudvps.by\/community\/?p=4290"},"modified":"2025-08-19T15:48:20","modified_gmt":"2025-08-19T12:48:20","slug":"kak-vesti-zhurnaly-sudo-i-root-komand-na-vps","status":"publish","type":"post","link":"https:\/\/cloudvps.by\/community\/kak-vesti-zhurnaly-sudo-i-root-komand-na-vps\/","title":{"rendered":"\u041a\u0430\u043a \u0432\u0435\u0441\u0442\u0438 \u0436\u0443\u0440\u043d\u0430\u043b\u044b sudo \u0438 root-\u043a\u043e\u043c\u0430\u043d\u0434 \u043d\u0430 VPS: \u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043a \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u043c\u0443"},"content":{"rendered":"\n<p>\u041a\u043e\u0433\u0434\u0430 \u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 <a href=\"https:\/\/cloudvps.by\/servers\/vps\/vps_server.php\" data-internallinksmanager029f6b8e52c=\"4\" title=\"VPS \u0445\u043e\u0441\u0442\u0438\u043d\u0433\">VPS<\/a>, \u0431\u044b\u043b\u043e \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0431\u043b\u0430\u0433\u043e\u0433\u043e\u0432\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0434 <code>sudo<\/code>. \u042f \u0437\u043d\u0430\u043b\u0430, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u0441\u043b\u043e\u043c\u0430\u0435\u0442\u0441\u044f \u2014 \u0432\u0438\u043d\u043e\u0432\u0430\u0442\u0430 \u0431\u0443\u0434\u0443 \u044f. \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e <a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/root-dostup\/\" data-internallinksmanager029f6b8e52c=\"234\" title=\"Root-\u0434\u043e\u0441\u0442\u0443\u043f\">root-\u0434\u043e\u0441\u0442\u0443\u043f<\/a> \u2014 \u044d\u0442\u043e \u043a\u0430\u043a \u0448\u0442\u0443\u0440\u0432\u0430\u043b \u0441\u0430\u043c\u043e\u043b\u0451\u0442\u0430: \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0446\u0435\u043b\u0438, \u0430 \u043c\u043e\u0436\u0435\u0442 \u0438 \u0432 \u0441\u0442\u0435\u043d\u0443.<\/p>\n\n\n\n<p>\u041d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u044f \u043f\u043e\u043d\u044f\u043b\u0430, \u043a\u0430\u043a \u0432\u0430\u0436\u043d\u043e <strong>\u0432\u0435\u0441\u0442\u0438 \u043b\u043e\u0433\u0438 \u0432\u0441\u0435\u0445 sudo \u0438 root-\u043a\u043e\u043c\u0430\u043d\u0434<\/strong>, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f, \u043a\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c. \u0418\u043b\u0438 \u0435\u0441\u043b\u0438 \u0432\u044b \u2014 \u0441\u0430\u043c\u0438 \u0441\u0435\u0431\u0435 DevOps, \u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u0441\u043f\u0430\u0442\u044c \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e, \u0437\u043d\u0430\u044f, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u0441\u043b\u0435\u0434\u0438\u0442\u044c, \u043a\u0442\u043e \u0438 \u043a\u043e\u0433\u0434\u0430 \u0447\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u0417\u0430\u0447\u0435\u043c \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c sudo \u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043e\u0442 root?<\/h2>\n\n\n\n<p>\u041e\u0442\u0432\u0435\u0442 <a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/downtime\/\" data-internallinksmanager029f6b8e52c=\"233\" title=\"Downtime (\u0412\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u044f)\">\u043f\u0440\u043e\u0441\u0442\u043e\u0439<\/a>: <strong>\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0438 \u0430\u0443\u0434\u0438\u0442<\/strong>.<br>\u0415\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0441 <code>sudo<\/code> \u0438\u043b\u0438 \u0437\u0430\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0434 <code>root<\/code>, \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u0432\u0438\u0434\u0435\u0442\u044c:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u043a\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e,<\/li>\n\n\n\n<li>\u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u043e\u0441\u044c,<\/li>\n\n\n\n<li>\u0438\u0437-\u043f\u043e\u0434 \u043a\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f,<\/li>\n\n\n\n<li>\u0441 \u043a\u0430\u043a\u043e\u0433\u043e <a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/ip-adres\/\" data-internallinksmanager029f6b8e52c=\"204\" title=\"IP-\u0430\u0434\u0440\u0435\u0441 (Internet Protocol)\">IP<\/a>-\u0430\u0434\u0440\u0435\u0441\u0430 (\u0435\u0441\u043b\u0438 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f).<\/li>\n<\/ul>\n\n\n\n<p>\u042d\u0442\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432\u0430\u0436\u043d\u043e \u0434\u043b\u044f:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u043a\u043e\u043c\u0430\u043d\u0434 \u0441 <code>sudo<\/code> \u043f\u0440\u0430\u0432\u0430\u043c\u0438;<\/li>\n\n\n\n<li>\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 <code>root<\/code>;<\/li>\n\n\n\n<li>\u0440\u0430\u0437\u0431\u043e\u0440\u043e\u0432 \u00ab\u0447\u0442\u043e \u043f\u043e\u0448\u043b\u043e \u043d\u0435 \u0442\u0430\u043a\u00bb \u043f\u043e\u0441\u043b\u0435 \u0441\u0431\u043e\u044f.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u0413\u0434\u0435 \u0438 \u043a\u0430\u043a \u0443\u0436\u0435 \u043b\u043e\u0433\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b sudo?<\/h2>\n\n\n\n<p>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>sudo<\/code> \u043b\u043e\u0433\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 <code>\/var\/log\/auth.log<\/code> (\u043d\u0430 Ubuntu \u0438 Debian), \u043b\u0438\u0431\u043e \u0432 <code>\/var\/log\/secure<\/code> (\u043d\u0430 CentOS\/AlmaLinux\/RHEL).<\/p>\n\n\n\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo cat \/var\/log\/auth.log | grep sudo\n<\/code><\/pre>\n\n\n\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0432\u043e\u0434\u0430:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Aug 14 15:03:22 vps sudo:   adminuser : TTY=pts\/0 ; PWD=\/home\/adminuser ; USER=root ; COMMAND=\/usr\/bin\/apt update\n<\/code><\/pre>\n\n\n\n<p>\u041d\u043e \u044d\u0442\u043e \u043b\u0438\u0448\u044c \u0447\u0430\u0441\u0442\u044c. \u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0432\u0435\u0441\u0442\u0438 <strong>\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0436\u0443\u0440\u043d\u0430\u043b<\/strong> \u0438\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c <strong>\u0434\u0435\u0442\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e<\/strong>, \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0447\u0443\u0442\u044c \u0433\u043b\u0443\u0431\u0436\u0435.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 sudoers \u0434\u043b\u044f \u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u043e\u0432<\/h2>\n\n\n\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b sudo:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo visudo\n<\/code><\/pre>\n\n\n\n<p>\u042d\u0442\u043e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c <code>\/etc\/sudoers<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043f\u0435\u0440\u0435\u0434 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c.<\/p>\n\n\n\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432 \u043a\u043e\u043d\u0435\u0446:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Defaults logfile=\"\/var\/log\/sudo.log\"\n<\/code><\/pre>\n\n\n\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0451, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u0441 <code>sudo<\/code>, \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c\u0441\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b <code>\/var\/log\/sudo.log<\/code>.<\/p>\n\n\n\n<p>\ud83d\udccc <strong>\u0412\u0430\u0436\u043d\u043e<\/strong>: \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e <code>logfile<\/code> \u043d\u0435 \u0434\u0443\u0431\u043b\u0438\u0440\u0443\u0435\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u043b\u043e\u0433\u0438, \u0438\u043d\u0430\u0447\u0435 \u0443 \u0432\u0430\u0441 \u0431\u0443\u0434\u0443\u0442 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u044b \u0441 rsyslog\/journald.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u041a\u0430\u043a \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c <em>\u0432\u0441\u0435<\/em> \u043a\u043e\u043c\u0430\u043d\u0434\u044b root-\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/h2>\n\n\n\n<p><code>sudo<\/code> \u2014 \u044d\u0442\u043e \u043f\u043e\u043b\u0434\u0435\u043b\u0430. \u041d\u043e \u0435\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u0432\u043e\u0448\u0451\u043b \u043a\u0430\u043a <code>root<\/code> (\u0447\u0435\u0440\u0435\u0437 <code>su -<\/code> \u0438\u043b\u0438 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043f\u043e \u043a\u043b\u044e\u0447\u0443\/\u043f\u0430\u0440\u043e\u043b\u044e), sudo \u0443\u0436\u0435 \u043d\u0435 \u0441\u043f\u0430\u0441\u0451\u0442. \u0422\u0443\u0442 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 <code>auditd<\/code>.<\/p>\n\n\n\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install auditd -y\n<\/code><\/pre>\n\n\n\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0430\u0432\u0438\u043b\u0430, \u043b\u043e\u0433\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a \u043b\u044e\u0431\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u043e\u0442 root:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo auditctl -a always,exit -F arch=b64 -F uid=0 -S execve -k root_cmds\n<\/code><\/pre>\n\n\n\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043b\u043e\u0433\u043e\u0432:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ausearch -k root_cmds\n<\/code><\/pre>\n\n\n\n<p>\u0412\u0441\u0451 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043e \u0432 <code>\/var\/log\/audit\/audit.log<\/code>.<\/p>\n\n\n\n<p>\ud83d\udca1 \u0421\u043e\u0432\u0435\u0442\u044b:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0432 <code>\/etc\/audit\/rules.d\/<\/code>, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u043b\u043e\u0441\u044c \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438;<\/li>\n\n\n\n<li>\u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u043c\u0435\u0441\u0442\u0430 \u043d\u0430 \u0434\u0438\u0441\u043a\u0435 \u043f\u043e\u0434 \u0442\u0430\u043a\u0438\u0435 \u043b\u043e\u0433\u0438.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u041a\u0430\u043a \u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u0438\u0442\u044c sudoers \u0444\u0430\u0439\u043b \u043e\u0442 \u043e\u0448\u0438\u0431\u043e\u043a<\/h2>\n\n\n\n<p>\u041e\u0448\u0438\u0431\u043a\u0438 \u0432 <code>\/etc\/sudoers<\/code> \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>sudo<\/code>. \u042f \u043e\u0434\u043d\u0430\u0436\u0434\u044b \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0430 \u043f\u0440\u043e\u0431\u0435\u043b \u043d\u0435 \u0442\u0443\u0434\u0430 \u2014 \u0438 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430.<\/p>\n\n\n\n<p>\ud83d\udd10 <strong>\u041f\u0440\u0430\u0432\u0438\u043b\u043e \u21161<\/strong>: \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 <code>visudo<\/code>.<br>\ud83d\udd10 <strong>\u041f\u0440\u0430\u0432\u0438\u043b\u043e \u21162<\/strong>: \u043d\u0435 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 <code>NOPASSWD<\/code> \u0434\u043e\u0441\u0442\u0443\u043f \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n\n\n\n<p>\u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u0442\u0440\u043e\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>adminuser ALL=(ALL) NOPASSWD: \/usr\/bin\/systemctl restart nginx\n<\/code><\/pre>\n\n\n\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c <code>adminuser<\/code> \u043c\u043e\u0436\u0435\u0442 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c <code>nginx<\/code> \u0431\u0435\u0437 \u043f\u0430\u0440\u043e\u043b\u044f \u2014 \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0433\u043e.<\/p>\n\n\n\n<p>\u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/sudoers.d\/adminuser\n<\/code><\/pre>\n\n\n\n<p>\u0418 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0443\u0434\u0430 \u0434\u043e\u0441\u0442\u0443\u043f. \u0422\u0430\u043a \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0435\u0435, \u0447\u0435\u043c \u043b\u0435\u0437\u0442\u044c \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 <code>\/etc\/sudoers<\/code>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0437 \u0436\u0438\u0437\u043d\u0438<\/h2>\n\n\n\n<p>\u0411\u044b\u043b\u0430 \u0443 \u043c\u0435\u043d\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f: \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u043d\u0430\u0447\u0430\u043b\u0438\u0441\u044c \u0441\u0431\u043e\u0438 \u0432 <code>nginx<\/code>. \u042f \u043f\u043e\u043b\u0435\u0437\u043b\u0430 \u0432 <code>\/var\/log\/auth.log<\/code>, \u0443\u0432\u0438\u0434\u0435\u043b\u0430, \u0447\u0442\u043e <code>sudo<\/code> \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0441\u044f 3 \u0440\u0430\u0437\u0430 \u043f\u043e\u0434\u0440\u044f\u0434 \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c, \u044f\u0432\u043d\u043e \u043d\u0435 \u043f\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043b\u043e\u0433\u0430\u043c \u044f \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u0430, \u0447\u0442\u043e \u043e\u043d \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b <code>nginx -s stop<\/code>, \u0432\u043c\u0435\u0441\u0442\u043e <code>reload<\/code>.<\/p>\n\n\n\n<p>\u0421 \u0442\u0435\u0445 \u043f\u043e\u0440 \u044f:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0432\u043a\u043b\u044e\u0447\u0430\u044e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433-\u0444\u0430\u0439\u043b \u0447\u0435\u0440\u0435\u0437 <code>sudoers<\/code>;<\/li>\n\n\n\n<li>\u043b\u043e\u0433\u0438\u0440\u0443\u044e <code>root<\/code>-\u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0447\u0435\u0440\u0435\u0437 <code>auditd<\/code>;<\/li>\n\n\n\n<li>\u0438 \u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432 <code>sudoers.d<\/code> \u0442\u043e\u0447\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u0430 \u043d\u0435 \u00ab\u0432\u0441\u0451 \u043f\u043e\u0434\u0440\u044f\u0434\u00bb.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0438 \u0430\u043d\u0430\u043b\u0438\u0437 sudo-\u043b\u043e\u0433\u043e\u0432<\/h2>\n\n\n\n<p>\u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo grep \"COMMAND=\" \/var\/log\/auth.log\n<\/code><\/pre>\n\n\n\n<p>\u0418\u043b\u0438 \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0432\u043a\u043b\u044e\u0447\u0451\u043d \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tail -f \/var\/log\/sudo.log\n<\/code><\/pre>\n\n\n\n<p>\u041c\u043e\u0436\u043d\u043e \u0434\u0430\u0436\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u0430\u043b\u0435\u0440\u0442\u043e\u0432 \u0432 Telegram, \u0435\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u2014 \u043d\u043e \u044d\u0442\u043e \u0442\u0435\u043c\u0430 \u0434\u043b\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u0418\u0442\u043e\u0433\u043e<\/h3>\n\n\n\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 VPS \u2014 \u0432\u044b \u0437\u0430 \u043d\u0435\u0433\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442\u0435. \u0418 \u0447\u0435\u043c \u0440\u0430\u043d\u044c\u0448\u0435 \u0432\u044b \u043d\u0430\u0447\u043d\u0451\u0442\u0435 <strong>\u0432\u0435\u0441\u0442\u0438 \u0443\u0447\u0451\u0442 \u043a\u043e\u043c\u0430\u043d\u0434<\/strong>, \u0442\u0435\u043c \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u0435\u0435 \u0431\u0443\u0434\u0435\u0442\u0435 \u0441\u043f\u0430\u0442\u044c. \u0423 \u043c\u0435\u043d\u044f \u044d\u0442\u043e \u0441\u0442\u0430\u043b\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e\u0439 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u043d\u043e\u0432\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435: \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 <code>sudoers<\/code>, <code>auditd<\/code>, \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0430 \u0438 \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u0430\u044f \u043a\u043e\u043f\u0438\u044f sudo-\u0444\u0430\u0439\u043b\u043e\u0432.<\/p>\n\n\n\n<p>\u041f\u0443\u0441\u0442\u044c <code>root<\/code> \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0442\u0435\u043d\u044c\u044e, \u0441\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0435\u0439 \u043e\u0448\u0438\u0431\u043a\u0438, \u0430 \u0441\u0442\u0430\u043d\u0435\u0442 \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u044b\u043c \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u043c\u044b\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c. \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u2014 \u044d\u0442\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c, \u043d\u043e \u0438 \u043f\u0440\u043e \u0434\u043e\u0432\u0435\u0440\u0438\u0435 \u043a \u0441\u0435\u0431\u0435 \u0438 \u0441\u0432\u043e\u0435\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041a\u043e\u0433\u0434\u0430 \u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 VPS, \u0431\u044b\u043b\u043e \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0431\u043b\u0430\u0433\u043e\u0433\u043e\u0432\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0434 sudo. \u042f \u0437\u043d\u0430\u043b\u0430, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u0441\u043b\u043e\u043c\u0430\u0435\u0442\u0441\u044f \u2014 \u0432\u0438\u043d\u043e\u0432\u0430\u0442\u0430 \u0431\u0443\u0434\u0443 \u044f. \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e root-\u0434\u043e\u0441\u0442\u0443\u043f \u2014 \u044d\u0442\u043e \u043a\u0430\u043a \u0448\u0442\u0443\u0440\u0432\u0430\u043b \u0441\u0430\u043c\u043e\u043b\u0451\u0442\u0430: \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0446\u0435\u043b\u0438, \u0430 \u043c\u043e\u0436\u0435\u0442 \u0438 \u0432 \u0441\u0442\u0435\u043d\u0443. \u041d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u044f \u043f\u043e\u043d\u044f\u043b\u0430, \u043a\u0430\u043a \u0432\u0430\u0436\u043d\u043e \u0432\u0435\u0441\u0442\u0438 \u043b\u043e\u0433\u0438 \u0432\u0441\u0435\u0445 sudo \u0438 root-\u043a\u043e\u043c\u0430\u043d\u0434, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":3538,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"class_list":["post-4290","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bezopasnost"],"_links":{"self":[{"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/posts\/4290","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/comments?post=4290"}],"version-history":[{"count":2,"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/posts\/4290\/revisions"}],"predecessor-version":[{"id":4292,"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/posts\/4290\/revisions\/4292"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/media\/3538"}],"wp:attachment":[{"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/media?parent=4290"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/categories?post=4290"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/tags?post=4290"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}