{"id":280297,"date":"2016-11-01T16:05:05","date_gmt":"2016-11-01T13:05:05","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=280297"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=280297","title":{"rendered":"\u041d\u0435\u0442 \u2013 \u0432\u0437\u043b\u043e\u043c\u0430\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432! \u0421\u043e\u0432\u0435\u0442\u044b \u043f\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u0438 \u0437\u0430\u0449\u0438\u0442\u0435"},"content":{"rendered":"<p>\u041f\u043e\u0434\u043e\u0437\u0440\u0435\u0432\u0430\u0435\u0442\u0435, \u0447\u0442\u043e Linux-\u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u0437\u043b\u043e\u043c\u0430\u043d? \u0423\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0432\u0441\u0451 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u043d\u043e \u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438? \u0415\u0441\u043b\u0438 \u0442\u0430\u043a \u2013 \u0432\u043e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u043e\u0432\u0435\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043d\u0430 \u043f\u0440\u0435\u0434\u043c\u0435\u0442 \u0432\u0437\u043b\u043e\u043c\u0430 \u0438 \u043b\u0443\u0447\u0448\u0435 \u0435\u0451 \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c.<\/p>\n<p>  <a href=\"https:\/\/habrahabr.ru\/company\/ruvds\/blog\/314166\/\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/eb1\/fdd\/91d\/eb1fdd91d160120b11242ff57907bcb3.jpg\" alt=\"image\" \/><\/div>\n<p><\/a><br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h3><font color=\"#3AC1EF\">\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430<\/font><\/h3>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c, \u043d\u0435 \u0432\u0437\u043b\u043e\u043c\u0430\u043b\u0438 \u043b\u0438 \u0432\u0430\u0448 \u0441\u0435\u0440\u0432\u0435\u0440, \u0441\u043a\u0430\u0436\u0435\u043c, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c Ubuntu, \u0441\u0442\u043e\u0438\u0442 \u043a\u043e\u0435-\u0447\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c.<\/p>\n<h4><font color=\"#3AC1EF\">\u258d\u0414\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0432\u0445\u043e\u0434\u0430 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443<\/font><\/h4>\n<p>  \u0412\u044b\u044f\u0441\u043d\u0438\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0432\u0445\u043e\u0434\u0430 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443. \u0414\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b lastlog.<\/p>\n<pre><code>$&gt;lastlog<\/code><\/pre>\n<p>  <\/p>\n<h4><font color=\"#3AC1EF\">\u258d\u0418\u0441\u0442\u043e\u0440\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434<\/font><\/h4>\n<p>  \u0412\u0437\u0433\u043b\u044f\u043d\u0438\u0442\u0435 \u043d\u0430 \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u043a\u043e\u043c\u0430\u043d\u0434, \u0443\u0437\u043d\u0430\u0439\u0442\u0435, \u043a\u043e\u0433\u0434\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0438\u0445 \u0432\u0432\u043e\u0434\u0438\u043b\u0438:<\/p>\n<pre><code>$&gt;history<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043c\u0430\u043d\u0434 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0431\u0435\u0437 \u0434\u0430\u0442\u044b \u2013 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u0442\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0443\u0442\u0438\u043b\u0438\u0442\u044b history.<\/p>\n<h4><font color=\"#3AC1EF\">\u258d\u0416\u0443\u0440\u043d\u0430\u043b auth.log<\/font><\/h4>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u2013 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0444\u0430\u0439\u043b\u0430 \/var\/log\/auth.log. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/p>\n<pre><code>$&gt;sudo vi \/var\/log\/auth.log<\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445, \u043a\u0442\u043e \u043f\u044b\u0442\u0430\u043b\u0441\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u043f\u043e SSH.<\/p>\n<h4><font color=\"#3AC1EF\">\u258dIP-\u0430\u0434\u0440\u0435\u0441\u0430<\/font><\/h4>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u044c IP-\u0430\u0434\u0440\u0435\u0441\u0430, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u043b\u0438\u0441\u044c \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code>$&gt;zgrep sshd \/var\/log\/auth.log* | grep rhost | sed -re 's\/.*rhost=([^ ]+).*\/\\1\/' | sort \u2013u<\/code><\/pre>\n<p>  <\/p>\n<h4><font color=\"#3AC1EF\">\u258d\u0416\u0443\u0440\u043d\u0430\u043b\u044b Apache<\/font><\/h4>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0436\u0443\u0440\u043d\u0430\u043b\u044b Apache:<\/p>\n<pre><code>$&gt;sudo vi \/var\/log\/apache2\/access.log $&gt;sudo vi \/var\/log\/apache2\/error.log<\/code><\/pre>\n<p>  <\/p>\n<h4><font color=\"#3AC1EF\">\u258d\u041f\u043e\u0438\u0441\u043a \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432<\/font><\/h4>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u0437\u043b\u043e\u043c\u0430\u043d, \u0440\u0430\u0437\u044b\u0449\u0438\u0442\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code>$&gt;ps aux | less<\/code><\/pre>\n<p>  <\/p>\n<h4><font color=\"#3AC1EF\">\u258d\u0421\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u0434\u0430\u043d\u0438\u0439 cron<\/font><\/h4>\n<p>  \u0410\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044f \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 \u043f\u0440\u0435\u0434\u043c\u0435\u0442 \u0432\u0437\u043b\u043e\u043c\u0430, \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u0434\u0430\u043d\u0438\u0439 cron, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0433 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0441\u0432\u043e\u0451.<\/p>\n<pre><code>$&gt;crontab -l | grep -v \u2018^#\u2019<\/code><\/pre>\n<p>  \u041d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0442\u043e\u0433\u043e, \u0432\u044b\u044f\u0432\u0438\u043b\u0430 \u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u0432\u0437\u043b\u043e\u043c\u0430, \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u043c\u043d\u043e\u0433\u043e \u043d\u0435 \u0431\u044b\u0432\u0430\u0435\u0442. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u0442 \u2013 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u0432\u0435\u0442\u043e\u0432 \u043f\u043e \u0437\u0430\u0449\u0438\u0442\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430.<\/p>\n<h3><font color=\"#3AC1EF\">\u0417\u0430\u0449\u0438\u0442\u0430<\/font><\/h3>\n<p>  \u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0438 \u043f\u043e \u0437\u0430\u0449\u0438\u0442\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c, \u043a\u0430\u0441\u0430\u044e\u0442\u0441\u044f \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0438 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f.<\/p>\n<h4><font color=\"#3AC1EF\">\u258d\u0417\u0430\u043f\u0440\u0435\u0442 \u0432\u0445\u043e\u0434\u0430 root-\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043f\u043e SSH<\/font><\/h4>\n<p>  \u0414\u043b\u044f \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u0443\u0440\u043e\u0432\u043d\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u043f\u0440\u0435\u0442\u0438\u0442\u044c \u0432\u0445\u043e\u0434 root-\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043f\u043e SSH. <\/p>\n<pre><code>$&gt;sudo vi \/etc\/ssh\/sshd_config PermitRootLogin no<\/code><\/pre>\n<p>  <\/p>\n<h4><font color=\"#3AC1EF\">\u258d\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f<\/font><\/h4>\n<p>  \u0412\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0430\u043a\u0435\u0442\u0430 unattended-upgrades. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0435\u0433\u043e \u043d\u0430\u0434\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c:<\/p>\n<pre><code>$&gt;sudo apt-get install unattended-upgrades<\/code><\/pre>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0448\u0430\u0433 \u2013 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430:<\/p>\n<pre><code>$&gt;sudo dpkg-reconfigure -plow unattended-upgrades<\/code><\/pre>\n<p>  \u041f\u0430\u043a\u0435\u0442 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0438 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e:<\/p>\n<pre><code>$&gt;sudo unattended-upgrade<\/code><\/pre>\n<p>  <\/p>\n<h4><font color=\"#3AC1EF\">\u258d\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043e\u043a<\/font><\/h4>\n<p>  \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u043f\u0430\u043a\u0435\u0442 fail2ban. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 SSH-\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c <a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-protect-ssh-with-fail2ban-on-ubuntu-12-04\">\u044d\u0442\u0438\u043c<\/a> \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e\u043c, \u043f\u043e\u043b\u0435 \u0447\u0435\u0433\u043e <a href=\"http:\/\/www.the-art-of-web.com\/system\/fail2ban-log\/\">\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u0442\u0435<\/a> \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043e\u0442\u0447\u0451\u0442\u043e\u0432.<br \/>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 fail2ban \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043b \u043d\u0435\u043a\u0438\u0439 IP-\u0430\u0434\u0440\u0435\u0441, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code>$&gt;sudo awk '($(NF-1) = \/Ban\/){print $NF}' \/var\/log\/fail2ban.log | sort | uniq -c | sort \u2013n<\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0435\u0441\u044c \u0444\u0430\u0439\u043b \u0436\u0443\u0440\u043d\u0430\u043b\u0430 fail2ban, \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code>$&gt;sudo zgrep -h &quot;Ban &quot;\/var\/log\/fail2ban.log* | awk '{print $NF}' | sort | uniq \u2013c<\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u0445 \u043f\u043e\u0434\u0441\u0435\u0442\u0435\u0439 \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442 \u0442\u0430\u043a\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430:<\/p>\n<pre><code>$&gt;sudo zgrep -h &quot;Ban &quot; \/var\/log\/fail2ban.log* | awk '{print $NF}' | awk -F\\. '{print $1&quot;.&quot;$2&quot;.&quot;}' | sort | uniq -c | sort -n | tail<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0430\u043d\u0430\u043b\u0438\u0437 \u0444\u0430\u0439\u043b\u043e\u0432 \u0436\u0443\u0440\u043d\u0430\u043b\u0430 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u0430\u0442\u0430\u043a\u0438 \u0438\u0437 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u0434\u0441\u0435\u0442\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e, \u0435\u0451 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0439 \u043e\u0441\u043d\u043e\u0432\u0435. \u041f\u0435\u0440\u0435\u0434 \u044d\u0442\u0438\u043c, \u043e\u0434\u043d\u0430\u043a\u043e, \u0441\u0442\u043e\u0438\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u043a \u043a\u0430\u043a\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0435 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u043f\u043e\u0434\u0441\u0435\u0442\u044c.<\/p>\n<p>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043e\u0442 \u043a\u0430\u043a \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a sshd-\u043f\u043e\u0440\u0442\u0443 \u0438\u0437 \u043f\u043e\u0434\u0441\u0435\u0442\u0438 221.229.*.*:<\/p>\n<pre><code>$&gt;sudo iptables -I INPUT -p tcp -s 221.229.0.0\/255.255.0.0 --dport ssh -j REJECT --reject-with tcp-reset<\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0431\u044b\u043b\u043e \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c\u0438 iptables, \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code>$&gt;sudo iptables -vnL INPUT --line-numbers<\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0430\u0432\u0438\u043b\u0430 iptables \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u043b\u0438\u0441\u044c \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0432 Ubuntu \u043f\u0430\u043a\u0435\u0442 iptables-persistent.<\/p>\n<pre><code>$&gt;sudo apt-get install iptables-persistent $&gt;cat \/etc\/iptables\/rules.v4<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 iptables, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0442\u0430\u043a\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code>$&gt;sudo bash -c &quot;iptables-save \u00a0&gt; \/etc\/iptables\/rules.v4&quot;<\/code><\/pre>\n<p>  \u0424\u0430\u0439\u043b \u0441 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c\u0438 \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u0442\u0430\u043a \u043a\u0430\u043a \u0435\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442 \u0432\u0430\u0436\u0435\u043d \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u043a\u0430\u043a \u043d\u0430\u0434\u043e.<\/p>\n<h3><font color=\"#3AC1EF\">\u0418\u0442\u043e\u0433\u0438<\/font><\/h3>\n<p>  \u041c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043b\u0438 \u043e \u043c\u0435\u0442\u043e\u0434\u0430\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 Linux-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u043d\u0430 \u043f\u0440\u0435\u0434\u043c\u0435\u0442 \u0432\u0437\u043b\u043e\u043c\u0430 \u0438 \u043e\u0431 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0438 \u0438\u0445 \u0437\u0430\u0449\u0438\u0442\u044b. \u041d\u0430\u0434\u0435\u0435\u043c\u0441\u044f, \u043d\u0430\u0448\u0438 \u0441\u043e\u0432\u0435\u0442\u044b \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u0432\u0430\u043c \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0432\u0430\u0448\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c.<br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/314166\/\"> https:\/\/habrahabr.ru\/post\/314166\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u043e\u0434\u043e\u0437\u0440\u0435\u0432\u0430\u0435\u0442\u0435, \u0447\u0442\u043e Linux-\u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u0437\u043b\u043e\u043c\u0430\u043d? \u0423\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0432\u0441\u0451 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u043d\u043e \u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438? \u0415\u0441\u043b\u0438 \u0442\u0430\u043a \u2013 \u0432\u043e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u043e\u0432\u0435\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043d\u0430 \u043f\u0440\u0435\u0434\u043c\u0435\u0442 \u0432\u0437\u043b\u043e\u043c\u0430 \u0438 \u043b\u0443\u0447\u0448\u0435 \u0435\u0451 \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c.<\/p>\n<p>  <a href=\"https:\/\/habrahabr.ru\/company\/ruvds\/blog\/314166\/\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/eb1\/fdd\/91d\/eb1fdd91d160120b11242ff57907bcb3.jpg\" alt=\"image\" \/><\/div>\n<p><\/a>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-280297","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/280297","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=280297"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/280297\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=280297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=280297"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=280297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}