{"id":396926,"date":"2024-06-29T13:08:23","date_gmt":"2024-06-29T13:08:23","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=396926"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-06-29T13:08:23","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=396926","title":{"rendered":"<span>\u041a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0441 \u0431\u0435\u043b\u044b\u043c ip \u0438\u0437 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0439 \u0441\u0435\u0442\u0438<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>Disclaimer<\/h2>\n<p>\u042f \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0441\u044c \u0441\u0435\u0442\u0435\u0432\u044b\u043c \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043e\u043c, \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0442\u0443\u0434\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0448\u0438\u043b \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u043c\u0438 \u0438 \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c, \u0447\u0442\u043e \u044f \u0432\u043e\u043e\u0431\u0449\u0435 \u0434\u0435\u043b\u0430\u043b. \u0411\u0443\u0434\u0443 \u043e\u0447\u0435\u043d\u044c \u0440\u0430\u0434 \u0435\u0441\u043b\u0438 \u043c\u0435\u043d\u044f \u043f\u043e\u043f\u0440\u0430\u0432\u044f\u0442 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445. \u042d\u0442\u043e\u0442 \u043a\u043e\u043d\u0441\u043f\u0435\u043a\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043f\u043e \u0434\u0440\u0443\u0433\u0438\u043c \u0441\u0442\u0430\u0442\u044c\u044f\u043c \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u043f\u0440\u043e\u0448\u0443 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u0440\u043e\u0432 \u0442\u0435\u0445 \u0433\u0430\u0439\u0434\u043e\u0432, \u0443 \u043d\u0438\u0445 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u044b \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u0430\u043c \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f.<\/p>\n<p>\u0411\u0443\u0434\u0443 \u0441\u0442\u0430\u0440\u0430\u0442\u044c\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0447\u0435\u043b\u043e\u0432\u0435\u043a, \u0437\u043d\u0430\u044e\u0449\u0438\u0439 \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0443\u0442\u0438, \u0432\u0441\u0435 \u043f\u043e\u043d\u044f\u043b.<\/p>\n<h2>\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041c\u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0434\u0430\u0432\u043d\u043e \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u0432\u0438\u0434\u0438\u043c\u044b\u0439 \u0438\u0437\u0432\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432 \u0441\u0432\u043e\u0435\u0439 \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0439 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0434\u043b\u044f pet \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0438\u043b\u0438 \u0436\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u0430-\u0432\u0438\u0437\u0438\u0442\u043a\u0438.<\/p>\n<p>\u0412\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441: \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0430\u043c\u0443\u044e \u043f\u0440\u043e\u0441\u0442\u0443\u044e VPS \u0438 \u043d\u0435 \u0442\u0440\u0430\u0442\u0438\u0442\u044c \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u0438 \u0441\u0432\u043e\u0435\u0433\u043e \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430? \u041e\u0442\u0432\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442: \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0431\u0435\u043b\u044b\u0439 ip \u0443 \u043c\u0435\u043d\u044f \u0443\u0436\u0435 \u0431\u044b\u043b \u0438 \u0434\u0430\u0432\u043d\u043e, \u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u044f \u0440\u0435\u0448\u0438\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u043a \u0430 \u0441\u0442\u0430\u0440\u044b\u0439 \u043d\u043e\u0443\u0442\u0431\u0443\u043a. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0442\u0440\u0430\u0442 \u043d\u0435 \u043f\u0440\u0435\u0434\u0432\u0438\u0434\u0435\u043b\u043e\u0441\u044c.<\/p>\n<h2>\u0427\u0442\u043e \u043c\u044b \u0438\u043c\u0435\u0435\u043c?<\/h2>\n<p>\u0414\u043b\u044f \u0441\u043f\u0440\u0430\u0432\u043a\u0438, \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 (2021) \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 VPS \u043d\u0430 \u0434\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u0435 &#8212; 400 \u0440\u0443\u0431. , \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0431\u0435\u043b\u043e\u0433\u043e ip \u0443 \u043c\u043e\u0435\u0433\u043e \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 &#8212; 179 \u0440\u0443\u0431.<\/p>\n<ul>\n<li>\n<p>\u041d\u043e\u0443\u0442\u0431\u0443\u043a (intel core i5 M 560 2,67 GHz, 4\/60Gb) \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0439 Ubuntu Server 20.04.3 (\u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u0447\u043d\u043e\u0439 \u0444\u043b\u0435\u0448\u043a\u0438 \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c rufus (win) \u0438\u043b\u0438 balenaEtcher (os x)<\/p>\n<\/li>\n<li>\n<p>\u0440\u043e\u0443\u0442\u0435\u0440 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u043c \u043f\u0430\u043a\u0435\u0442\u043e\u043c &#171;\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 ip \u0430\u0434\u0440\u0435\u0441&#187;<\/p>\n<\/li>\n<li>\n<p>\u0432\u0442\u043e\u0440\u043e\u0439 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432 (\u0432\u0441\u0435 \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u043c\u043e\u0436\u043d\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438 \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435, \u0432\u043e\u043f\u0440\u043e\u0441 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430)<\/p>\n<\/li>\n<li>\n<p>\u0445\u043e\u0440\u043e\u0448\u0430\u044f \u043c\u0443\u0437\u044b\u043a\u0430 \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0435 \u0431\u044b\u043b \u0441\u043a\u0443\u0447\u043d\u044b\u043c<\/p>\n<\/li>\n<\/ul>\n<h2>\u041a\u0430\u043a\u0430\u044f \u0446\u0435\u043b\u044c?<\/h2>\n<p>\u0421\u0434\u0435\u043b\u0430\u0442\u044c python3 flask (\u0432\u0437\u044f\u043b \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b) \u0441\u0435\u0440\u0432\u0435\u0440 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 \u0438\u0437 \u0432\u043d\u0435.<\/p>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0433\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0430\u0434\u0440\u0435\u0441\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440<\/h2>\n<p>\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0439 ip \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438. \u041f\u043e \u0438\u0434\u0435\u0435 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f DHCP (\u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043a\u0430\u0436\u0434\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0432 \u0441\u0435\u0442\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 ip \u0430\u0434\u0440\u0435\u0441, \u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0439 \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0447\u0442\u043e\u0431\u044b \u0440\u043e\u0443\u0442\u0435\u0440 \u0432\u0441\u0435\u0433\u0434\u0430 \u0437\u043d\u0430\u043b \u043a\u0443\u0434\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b)<\/p>\n<ol>\n<li>\n<p>\u0421\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>ifconfig<\/code><\/p>\n<\/li>\n<li>\n<p>\u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e \u043a\u0430\u043a\u043e\u0439 \u0442\u0438\u043f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c (\u043a\u0430\u0431\u0435\u043b\u044c \u0438\u043b\u0438 wi-fi) \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0432 \u043a\u0430\u0442\u043e\u043b\u043e\u0433\u0435 <code>\/etc\/netplan<\/code><\/p>\n<p>\u0418 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code>network:     ethernets:         ethx:             dhcp4: no             dhcp6: no             addresses: [192.168.1.200\/24, ]             gateway4: 192.168.1.1             nameservers:                 addresses: [192.168.1.1, ]     version: 2<\/code><\/pre>\n<p><code>ethx<\/code> &#8212; \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0438\u0434\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u0430\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0442 \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<ul>\n<li>\n<p><code>addresses<\/code> (6) &#8212; \u0430\u0434\u0440\u0435\u0441 \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438, \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u043e \u0447\u0442\u043e \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u043c<\/p>\n<p><code>\/24<\/code> \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043c\u0430\u0441\u043a\u0443 \u0441\u0435\u0442\u0438 (255.255.255.0), \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0432\u044b\u0435 3 \u0447\u0438\u0441\u043b\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0441 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u0430\u0434\u0440\u0435\u0441\u043e\u043c \u0440\u043e\u0443\u0442\u0435\u0440\u0430,  \u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0447\u0438\u0441\u043b\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u043b\u044c\u043d\u043e. \u042f \u0432\u044b\u0431\u0440\u0430\u043b \u0430\u0434\u0440\u0435\u0441 192.168.1.200<\/p>\n<\/li>\n<li>\n<p><code>gateway4<\/code> &#8212; \u0448\u043b\u044e\u0437 \u043d\u0430\u0448\u0435\u0439 \u0441\u0435\u0442\u0438, \u0442\u043e \u0435\u0441\u0442\u044c \u0440\u043e\u0443\u0442\u0435\u0440. \u0415\u0433\u043e \u0430\u0434\u0440\u0435\u0441 192.168.1.1, \u043e\u0431\u044b\u0447\u043d\u043e \u043e\u043d \u043e\u0431\u0449\u0438\u0439 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0440\u043e\u0443\u0442\u0435\u0440\u043e\u0432 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u043e\u0433\u0443\u0433\u043b\u0438\u0442\u0435 (\u0438\u043d\u043e\u0433\u0434\u0430 \u0435\u0433\u043e \u0430\u0434\u0440\u0435\u0441 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043c \u0436\u0435 \u0433\u0434\u0435 \u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u043e\u0442 wi-fi)<\/p>\n<\/li>\n<li>\n<p>\u0432 \u0441\u0442\u0440\u043e\u043a\u0435 <code>nameservers: addresses<\/code> (9) \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0442\u043e\u0442 \u0436\u0435 \u0430\u0434\u0440\u0435\u0441 \u0447\u0442\u043e \u0438 \u0432 <code>gateway4<\/code> (\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u0435, \u043d\u043e \u044f \u0431\u0435\u0441\u043f\u043e\u043d\u044f\u0442\u0438\u044f \u0447\u0442\u043e \u044d\u0442\u043e)<\/p>\n<\/li>\n<li>\n<p><code>dhcp4: no<\/code> \u0438 <code>dhcp6: no<\/code> \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442, \u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b DHCP<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430:<\/p>\n<ul>\n<li>\n<p>\u041d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435:<\/p>\n<p><code>sudo tcpdump -i ethx icmp and icmp[icmptype]=icmp-echo<\/code><\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 \u0442\u0435\u043c \u043a\u0442\u043e \u043d\u0430\u0441 \u043f\u0438\u043d\u0433\u0443\u0435\u0442.<\/p>\n<\/li>\n<li>\n<p>\u0418 \u043f\u0438\u043d\u0433\u0443\u0435\u043c \u0435\u0433\u043e \u0441 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u043a \u0432\u043d\u0443\u0442\u0440\u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <code>192.168.1.200<\/code>.<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0441\u0442\u0440\u043e\u0438\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0435\u0441\u0442\u044c \u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0443 \u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0430-\u0441\u0435\u0440\u0432\u0435\u0440\u0430: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>ping<\/code> \u0441 \u0434\u043e\u043c\u0435\u043d\u043e\u043c <code>google.com<\/code>.<\/p>\n<p>\u0412\u0441\u0435 \u044d\u0442\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 <a href=\"https:\/\/adminguide.ru\/2018\/09\/24\/ubuntu-server-18-04-%D1%83%D1%81%D1%82%D0%B0%D0%BD%D0%BE%D0%B2%D0%BA%D0%B0-%D1%81%D1%82%D0%B0%D1%82%D0%B8%D1%87%D0%B5%D1%81%D0%BA%D0%BE%D0%B3%D0%BE-ip\/\" rel=\"noopener noreferrer nofollow\">\u044d\u0442\u043e\u0439<\/a> \u0441\u0442\u0430\u0442\u044c\u0435 \u0434\u043b\u044f Ubuntu, \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043e\u0432 \u0433\u0443\u0433\u043b\u0438\u0442\u0435 &#171;\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e ip &lt;\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0430>&#187;.<\/p>\n<p>\u0412\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442? \u0418\u0434\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435!<\/p>\n<h2>\u0420\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0440\u043e\u0443\u0442\u0435\u0440\u0443 \u043f\u0440\u043e \u0441\u0435\u0440\u0432\u0435\u0440<\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0435\u0440 \u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0434\u0435\u043b\u043e \u0441 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u043c ip \u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b DHCP. \u0421\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0440\u043e\u0443\u0442\u0435\u0440\u0443, \u0447\u0442\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c \u0440\u043e\u0443\u0442\u0435\u0440\u0430 \u0432\u0431\u0438\u0432\u0430\u0435\u043c \u0432 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0435\u0433\u043e ip \u0430\u0434\u0440\u0435\u0441.<\/p>\n<p>\u0415\u0441\u0442\u044c \u0434\u0432\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430:<\/p>\n<ul>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c DMZ \u0437\u043e\u043d\u0443 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0440\u043e\u0443\u0442\u0435\u0440\u0430 \u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0442\u0443\u0434\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u042d\u0442\u0438\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043c \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u043c \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043b\u044e\u0431\u043e\u0439 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u043d\u0435\u043c\u0443.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043f\u043e\u0440\u0442\u044b \u043d\u0443\u0436\u043d\u044b\u0445 \u043d\u0430\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 \u0440\u043e\u0443\u0442\u0435\u0440 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 (\u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u0440\u0442\u043e\u0432). \u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u043f\u043e\u0440\u0442 SSH (22) \u0438 flask (5000)<\/p>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u043f\u0438\u043d\u0433\u0430\u043d\u0443\u0442\u044c \u0435\u0433\u043e \u0438\u0437 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0441\u0435\u0442\u0438. <\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u0441\u0435 \u043d\u043e\u0440\u043c? \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u0438\u0434\u0435\u043d \u0438\u0437 \u0432\u043d\u0435, \u0441\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u043e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438.<\/p>\n<h2>\u0417\u0430\u0449\u0438\u0442\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430<\/h2>\n<p>\u042f \u0431\u0443\u0434\u0443 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c <code>SSH<\/code>, <code>Firewall<\/code> \u0438 <code>fail2ban<\/code> \u043f\u043e<a href=\"https:\/\/habr.com\/ru\/company\/vdsina\/blog\/521388\/\" rel=\"noopener noreferrer nofollow\"> \u0432\u043e\u0442 \u044d\u0442\u043e\u043c\u0443<\/a> \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u0435\u043c\u0443 \u0433\u0430\u0439\u0434\u0443. (\u0435\u0449\u0435 \u0440\u0430\u0437, \u043c\u043e\u044f \u0446\u0435\u043b\u044c <strong>\u043d\u0435 \u0441\u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0438\u0442\u044c<\/strong> \u0432\u0441\u0435 \u0447\u0442\u043e \u044f \u043d\u0430\u0448\u0435\u043b, \u0430 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u0435 \u0432 \u043e\u0434\u043d\u043e \u043c\u0435\u0441\u0442\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c) \u042f \u0434\u0435\u043b\u0430\u044e \u0432\u0441\u0435 \u0434\u043b\u044f Ubuntu Server, \u043d\u043e \u0432 \u0442\u043e\u043c \u0433\u0430\u0439\u0434\u0435 \u0435\u0441\u0442\u044c \u0434\u043b\u044f CentOS \u0438 Red Hat.<\/p>\n<p>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0435\u0449\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e\u043c\u0438\u043c\u043e root (1), \u0437\u0430\u0434\u0430\u0434\u0438\u043c \u0435\u043c\u0443 \u043f\u0430\u0440\u043e\u043b\u044c (2) \u0438 \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c root \u043f\u0440\u0438\u0432\u0435\u043b\u0435\u0433\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 sudo (3):<\/p>\n<pre><code>useradd [options] &lt;username> passwd &lt;username> usermod -aG sudo &lt;username><\/code><\/pre>\n<h3>SSH<\/h3>\n<p>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0439\u0442\u0435 \u043f\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0432 <span>\u0441\u0442\u0430\u0442\u044c\u0435<\/span> \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u043e\u0439 \u0432\u044b\u0448\u0435. \u0422\u0430\u043c \u043c\u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u0447\u0435\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u043a\u0440\u043e\u043c\u0435 \u043f\u043e\u0434\u0440\u043e\u043d\u043e\u0441\u0442\u0435\u0439 \u043e public \u0438 private \u043a\u043b\u044e\u0447\u0430\u0445:<\/p>\n<ul>\n<li>\n<p><code>ssh-keygen -t rsa<\/code> \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 2 \u043a\u043b\u044e\u0447\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 (\u0442\u043e\u0442 \u0447\u0442\u043e \u0438\u043c\u0435\u0435\u0442 .<code>pub<\/code>) \u0438 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0439 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 (\u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0442\u0430\u043a\u043e\u0433\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f)<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u043a\u043b\u044e\u0447 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432 \u0444\u0430\u0439\u043b <code>authorized_keys<\/code> \u0432 \u043f\u0430\u043f\u043a\u0435 <code>\/.ssh<\/code> \u0432 \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f (<code>\/home\/username\/.shh\/authorized_key<\/code>)<\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code>cat ~\/.ssh\/id_rsa.pub | ssh root@ip-\u0430\u0434\u0440\u0435\u0441-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 'cat >> ~\/.ssh\/authorized_keys'<\/code><\/pre>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u0417\u0430\u043a\u0440\u044b\u0442\u044b\u0439 \u043a\u043b\u044e\u0447 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0441\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u0435\u0433\u043e \u043a\u0443\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c<\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u044e\u0447 \u0434\u043b\u044f \u0432\u0445\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<\/li>\n<\/ul>\n<pre><code>ssh -i &lt;\u043f\u0443\u0442\u044c \u043a \u043a\u043b\u044e\u0447\u0443> &lt;\u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f>@&lt;\u0430\u0434\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430><\/code><\/pre>\n<p><em>\u0412\u0430\u0436\u043d\u043e \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u043f\u043e \u043f\u0430\u0440\u043e\u043b\u044e \u0438\u043d\u0430\u0447\u0435 \u043c\u044b \u0432\u0441\u0435 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u043b\u0438 \u0437\u0440\u044f.<\/em><\/p>\n<h3>Firewall<\/h3>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0440\u043e\u0431\u0440\u043e\u0441 \u043f\u043e\u0440\u0442\u043e\u0432 \u043c\u044b \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u043b\u0438\u0448\u044c \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043f\u043e\u0440\u0442\u0430\u043c, \u043d\u043e DMZ \u0437\u043e\u043d\u0430 \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435 \u0442\u0438\u043f\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f DMZ \u0437\u043e\u043d\u0443 \u043d\u0430\u043c \u0441\u0442\u0440\u043e\u0438\u0442 \u043f\u043e\u0434\u043d\u044f\u0442\u044c FireWall \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435,  \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a\u0430\u043a \u0440\u0430\u0437 \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0440\u0442\u043e\u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b.<\/p>\n<p>\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 SSH (1) \u0438 \u043f\u043e\u0440\u0442\u0430 5000 (2) \u0432 ufw (Firewall), \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c Firewall (3):<\/p>\n<pre><code>sudo ufw allow ssh sudo ufw allow 5000\/tcp sudo ufw enable<\/code><\/pre>\n<p><em>\u041f\u043e\u0434\u043d\u044f\u0432 FireWall \u0432\u0430\u0436\u043d\u043e \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u043e\u0440\u0442\u0443 SSH (22) \u0438 \u043f\u043e\u0440\u0442\u0443 Flask (5000) (\u043d\u0443 \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u041f\u041e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c). \u042f \u0437\u0430\u0431\u044b\u043b \u0438 \u0434\u043e\u043b\u0433\u043e \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043b, \u043f\u043e\u0447\u0435\u043c\u0443 \u043c\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0435 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442.<\/em><\/p>\n<p>\u041d\u0430 <a href=\"https:\/\/1cloud.ru\/help\/security\/ispolzovanie-utility-ufw-na-inux\" rel=\"noopener noreferrer nofollow\">\u0441\u0430\u0439\u0442\u0435 <\/a>\u0445\u043e\u0440\u043e\u0448\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043d\u044b \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f Firewall-\u043e\u043c.<\/p>\n<h3>Fail2ban<\/h3>\n<p>Fail2ban \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u044d\u0442\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u0442 \u043f\u043e\u0434\u0431\u043e\u0440 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 SSH.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0435\u0433\u043e (1) \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c (2, 3):<\/p>\n<pre><code>sudo apt install fail2ban systemctl start fail2ban systemctl enable fail2ban<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0435\u0433\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u044d\u0442\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b:<code>\/etc\/fail2ban\/fail2ban.conf<\/code>\u00a0\u0438\u00a0<code>\/etc\/fail2ban\/jail.conf<\/code>. \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u0437\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u043a \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0432\u0440\u0435\u043c\u044f \u0431\u0430\u043d\u0430.<\/p>\n<h2>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f<\/h2>\n<ol>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c flask \u0438 python3:<\/p>\n<pre><code>sudo apt install python3 sudo apt install pip pip install flask<\/code><\/pre>\n<\/li>\n<li>\n<p>\u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u0434 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0441 <a href=\"https:\/\/flask.palletsprojects.com\/en\/2.0.x\/quickstart\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0430\u0439\u0442\u0430<\/a> \u0432 \u0444\u0430\u0439\u043b <code>server.py<\/code>:<\/p>\n<pre><code class=\"python\">from flask import Flask  app = Flask(__name__)  @app.route(\"\/\") def hello_world():     return \"&lt;p>Hello, World!&lt;\/p>\"<\/code><\/pre>\n<p>\u041d\u0430\u0445\u043e\u0434\u044f\u0441\u044c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0441 \u044d\u0442\u0438\u043c \u0444\u0430\u0439\u043b\u043e\u043c, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0441\u0435\u0440\u0432\u0435\u0440:<\/p>\n<pre><code>export FLASK_APP=server.py flask run -h &lt;\u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430> -p 5000<\/code><\/pre>\n<p>\u0421\u0435\u0440\u0432\u0435\u0440 \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u043d\u0435\u043c\u0443 \u0441 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u0440\u044f\u043c\u043e \u0447\u0435\u0440\u0435\u0437 \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435, \u0432\u0432\u043e\u0434\u044f \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0430\u0434\u0440\u0435\u0441 \u043d\u0430\u0448\u0435\u0433\u043e \u0440\u043e\u0443\u0442\u0435\u0440\u0430, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443:<\/p>\n<pre><code>94.123.45.70:5000\/<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 &#171;Hello, World!&#187;. \u041d\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e? \u041f\u0440\u043e\u0439\u0434\u0438\u0442\u0435\u0441\u044c \u043f\u043e \u043c\u043e\u0438\u043c \u0437\u0430\u043c\u0435\u0442\u043a\u0430\u043c \u0432 \u044d\u0442\u043e\u043c \u0433\u0430\u0439\u0434\u0435 \u0435\u0449\u0435 \u0440\u0430\u0437.<\/p>\n<\/li>\n<\/ol>\n<h2>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438<\/h2>\n<ul>\n<li>\n<p><a href=\"https:\/\/hackware.ru\/?p=4780\" rel=\"noopener noreferrer nofollow\">https:\/\/hackware.ru\/?p=4780<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/1cloud.ru\/help\/security\/ispolzovanie-utility-ufw-na-inux\" rel=\"noopener noreferrer nofollow\">https:\/\/1cloud.ru\/help\/security\/ispolzovanie-utility-ufw-na-inux<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/flask.palletsprojects.com\/en\/2.0.x\/quickstart\/\" rel=\"noopener noreferrer nofollow\">https:\/\/flask.palletsprojects.com\/en\/2.0.x\/quickstart\/<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/firstvds.ru\/technology\/dobavit-ssh-klyuch\" rel=\"noopener noreferrer nofollow\">https:\/\/firstvds.ru\/technology\/dobavit-ssh-klyuch<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/company\/vdsina\/blog\/521388\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/company\/vdsina\/blog\/521388\/<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/adminguide.ru\/2018\/09\/24\/ubuntu-server-18-04-%D1%83%D1%81%D1%82%D0%B0%D0%BD%D0%BE%D0%B2%D0%BA%D0%B0-%D1%81%D1%82%D0%B0%D1%82%D0%B8%D1%87%D0%B5%D1%81%D0%BA%D0%BE%D0%B3%D0%BE-ip\/\" rel=\"noopener noreferrer nofollow\">https:\/\/adminguide.ru\/2018\/09\/24\/ubuntu-server-18-04-\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430-\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e-ip\/<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/blog.sedicomm.com\/2018\/07\/22\/kak-otklyuchit-login-root-po-ssh-v-linux\/\" rel=\"noopener noreferrer nofollow\">https:\/\/blog.sedicomm.com\/2018\/07\/22\/kak-otklyuchit-login-root-po-ssh-v-linux\/<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><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:\/\/habr.com\/ru\/articles\/579924\/\"> https:\/\/habr.com\/ru\/articles\/579924\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>Disclaimer<\/h2>\n<p>\u042f \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0441\u044c \u0441\u0435\u0442\u0435\u0432\u044b\u043c \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043e\u043c, \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0442\u0443\u0434\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0448\u0438\u043b \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u043c\u0438 \u0438 \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c, \u0447\u0442\u043e \u044f \u0432\u043e\u043e\u0431\u0449\u0435 \u0434\u0435\u043b\u0430\u043b. \u0411\u0443\u0434\u0443 \u043e\u0447\u0435\u043d\u044c \u0440\u0430\u0434 \u0435\u0441\u043b\u0438 \u043c\u0435\u043d\u044f \u043f\u043e\u043f\u0440\u0430\u0432\u044f\u0442 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445. \u042d\u0442\u043e\u0442 \u043a\u043e\u043d\u0441\u043f\u0435\u043a\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043f\u043e \u0434\u0440\u0443\u0433\u0438\u043c \u0441\u0442\u0430\u0442\u044c\u044f\u043c \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u043f\u0440\u043e\u0448\u0443 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u0440\u043e\u0432 \u0442\u0435\u0445 \u0433\u0430\u0439\u0434\u043e\u0432, \u0443 \u043d\u0438\u0445 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u044b \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u0430\u043c \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f.<\/p>\n<p>\u0411\u0443\u0434\u0443 \u0441\u0442\u0430\u0440\u0430\u0442\u044c\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0447\u0435\u043b\u043e\u0432\u0435\u043a, \u0437\u043d\u0430\u044e\u0449\u0438\u0439 \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0443\u0442\u0438, \u0432\u0441\u0435 \u043f\u043e\u043d\u044f\u043b.<\/p>\n<h2>\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041c\u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0434\u0430\u0432\u043d\u043e \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u0432\u0438\u0434\u0438\u043c\u044b\u0439 \u0438\u0437\u0432\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432 \u0441\u0432\u043e\u0435\u0439 \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0439 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0434\u043b\u044f pet \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0438\u043b\u0438 \u0436\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u0430-\u0432\u0438\u0437\u0438\u0442\u043a\u0438.<\/p>\n<p>\u0412\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441: \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0430\u043c\u0443\u044e \u043f\u0440\u043e\u0441\u0442\u0443\u044e VPS \u0438 \u043d\u0435 \u0442\u0440\u0430\u0442\u0438\u0442\u044c \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u0438 \u0441\u0432\u043e\u0435\u0433\u043e \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430? \u041e\u0442\u0432\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442: \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0431\u0435\u043b\u044b\u0439 ip \u0443 \u043c\u0435\u043d\u044f \u0443\u0436\u0435 \u0431\u044b\u043b \u0438 \u0434\u0430\u0432\u043d\u043e, \u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u044f \u0440\u0435\u0448\u0438\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u043a \u0430 \u0441\u0442\u0430\u0440\u044b\u0439 \u043d\u043e\u0443\u0442\u0431\u0443\u043a. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0442\u0440\u0430\u0442 \u043d\u0435 \u043f\u0440\u0435\u0434\u0432\u0438\u0434\u0435\u043b\u043e\u0441\u044c.<\/p>\n<h2>\u0427\u0442\u043e \u043c\u044b \u0438\u043c\u0435\u0435\u043c?<\/h2>\n<p>\u0414\u043b\u044f \u0441\u043f\u0440\u0430\u0432\u043a\u0438, \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 (2021) \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 VPS \u043d\u0430 \u0434\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u0435 &#8212; 400 \u0440\u0443\u0431. , \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0431\u0435\u043b\u043e\u0433\u043e ip \u0443 \u043c\u043e\u0435\u0433\u043e \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 &#8212; 179 \u0440\u0443\u0431.<\/p>\n<ul>\n<li>\n<p>\u041d\u043e\u0443\u0442\u0431\u0443\u043a (intel core i5 M 560 2,67 GHz, 4\/60Gb) \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0439 Ubuntu Server 20.04.3 (\u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u0447\u043d\u043e\u0439 \u0444\u043b\u0435\u0448\u043a\u0438 \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c rufus (win) \u0438\u043b\u0438 balenaEtcher (os x)<\/p>\n<\/li>\n<li>\n<p>\u0440\u043e\u0443\u0442\u0435\u0440 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u043c \u043f\u0430\u043a\u0435\u0442\u043e\u043c &#171;\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 ip \u0430\u0434\u0440\u0435\u0441&#187;<\/p>\n<\/li>\n<li>\n<p>\u0432\u0442\u043e\u0440\u043e\u0439 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432 (\u0432\u0441\u0435 \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u043c\u043e\u0436\u043d\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438 \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435, \u0432\u043e\u043f\u0440\u043e\u0441 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430)<\/p>\n<\/li>\n<li>\n<p>\u0445\u043e\u0440\u043e\u0448\u0430\u044f \u043c\u0443\u0437\u044b\u043a\u0430 \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0435 \u0431\u044b\u043b \u0441\u043a\u0443\u0447\u043d\u044b\u043c<\/p>\n<\/li>\n<\/ul>\n<h2>\u041a\u0430\u043a\u0430\u044f \u0446\u0435\u043b\u044c?<\/h2>\n<p>\u0421\u0434\u0435\u043b\u0430\u0442\u044c python3 flask (\u0432\u0437\u044f\u043b \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b) \u0441\u0435\u0440\u0432\u0435\u0440 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 \u0438\u0437 \u0432\u043d\u0435.<\/p>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0433\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0430\u0434\u0440\u0435\u0441\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440<\/h2>\n<p>\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0439 ip \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438. \u041f\u043e \u0438\u0434\u0435\u0435 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f DHCP (\u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043a\u0430\u0436\u0434\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0432 \u0441\u0435\u0442\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 ip \u0430\u0434\u0440\u0435\u0441, \u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0439 \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0447\u0442\u043e\u0431\u044b \u0440\u043e\u0443\u0442\u0435\u0440 \u0432\u0441\u0435\u0433\u0434\u0430 \u0437\u043d\u0430\u043b \u043a\u0443\u0434\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b)<\/p>\n<ol>\n<li>\n<p>\u0421\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>ifconfig<\/code><\/p>\n<\/li>\n<li>\n<p>\u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e \u043a\u0430\u043a\u043e\u0439 \u0442\u0438\u043f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c (\u043a\u0430\u0431\u0435\u043b\u044c \u0438\u043b\u0438 wi-fi) \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0432 \u043a\u0430\u0442\u043e\u043b\u043e\u0433\u0435 <code>\/etc\/netplan<\/code><\/p>\n<p>\u0418 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code>network:     ethernets:         ethx:             dhcp4: no             dhcp6: no             addresses: [192.168.1.200\/24, ]             gateway4: 192.168.1.1             nameservers:                 addresses: [192.168.1.1, ]     version: 2<\/code><\/pre>\n<p><code>ethx<\/code> &#8212; \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0438\u0434\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u0430\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0442 \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<ul>\n<li>\n<p><code>addresses<\/code> (6) &#8212; \u0430\u0434\u0440\u0435\u0441 \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438, \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u043e \u0447\u0442\u043e \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u043c<\/p>\n<p><code>\/24<\/code> \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043c\u0430\u0441\u043a\u0443 \u0441\u0435\u0442\u0438 (255.255.255.0), \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0432\u044b\u0435 3 \u0447\u0438\u0441\u043b\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0441 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u0430\u0434\u0440\u0435\u0441\u043e\u043c \u0440\u043e\u0443\u0442\u0435\u0440\u0430,  \u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0447\u0438\u0441\u043b\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u043b\u044c\u043d\u043e. \u042f \u0432\u044b\u0431\u0440\u0430\u043b \u0430\u0434\u0440\u0435\u0441 192.168.1.200<\/p>\n<\/li>\n<li>\n<p><code>gateway4<\/code> &#8212; \u0448\u043b\u044e\u0437 \u043d\u0430\u0448\u0435\u0439 \u0441\u0435\u0442\u0438, \u0442\u043e \u0435\u0441\u0442\u044c \u0440\u043e\u0443\u0442\u0435\u0440. \u0415\u0433\u043e \u0430\u0434\u0440\u0435\u0441 192.168.1.1, \u043e\u0431\u044b\u0447\u043d\u043e \u043e\u043d \u043e\u0431\u0449\u0438\u0439 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0440\u043e\u0443\u0442\u0435\u0440\u043e\u0432 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u043e\u0433\u0443\u0433\u043b\u0438\u0442\u0435 (\u0438\u043d\u043e\u0433\u0434\u0430 \u0435\u0433\u043e \u0430\u0434\u0440\u0435\u0441 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043c \u0436\u0435 \u0433\u0434\u0435 \u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u043e\u0442 wi-fi)<\/p>\n<\/li>\n<li>\n<p>\u0432 \u0441\u0442\u0440\u043e\u043a\u0435 <code>nameservers: addresses<\/code> (9) \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0442\u043e\u0442 \u0436\u0435 \u0430\u0434\u0440\u0435\u0441 \u0447\u0442\u043e \u0438 \u0432 <code>gateway4<\/code> (\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u0435, \u043d\u043e \u044f \u0431\u0435\u0441\u043f\u043e\u043d\u044f\u0442\u0438\u044f \u0447\u0442\u043e \u044d\u0442\u043e)<\/p>\n<\/li>\n<li>\n<p><code>dhcp4: no<\/code> \u0438 <code>dhcp6: no<\/code> \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442, \u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b DHCP<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430:<\/p>\n<ul>\n<li>\n<p>\u041d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435:<\/p>\n<p><code>sudo tcpdump -i ethx icmp and icmp[icmptype]=icmp-echo<\/code><\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 \u0442\u0435\u043c \u043a\u0442\u043e \u043d\u0430\u0441 \u043f\u0438\u043d\u0433\u0443\u0435\u0442.<\/p>\n<\/li>\n<li>\n<p>\u0418 \u043f\u0438\u043d\u0433\u0443\u0435\u043c \u0435\u0433\u043e \u0441 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u043a \u0432\u043d\u0443\u0442\u0440\u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <code>192.168.1.200<\/code>.<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0441\u0442\u0440\u043e\u0438\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0435\u0441\u0442\u044c \u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0443 \u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0430-\u0441\u0435\u0440\u0432\u0435\u0440\u0430: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>ping<\/code> \u0441 \u0434\u043e\u043c\u0435\u043d\u043e\u043c <code>google.com<\/code>.<\/p>\n<p>\u0412\u0441\u0435 \u044d\u0442\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 <a href=\"https:\/\/adminguide.ru\/2018\/09\/24\/ubuntu-server-18-04-%D1%83%D1%81%D1%82%D0%B0%D0%BD%D0%BE%D0%B2%D0%BA%D0%B0-%D1%81%D1%82%D0%B0%D1%82%D0%B8%D1%87%D0%B5%D1%81%D0%BA%D0%BE%D0%B3%D0%BE-ip\/\" rel=\"noopener noreferrer nofollow\">\u044d\u0442\u043e\u0439<\/a> \u0441\u0442\u0430\u0442\u044c\u0435 \u0434\u043b\u044f Ubuntu, \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043e\u0432 \u0433\u0443\u0433\u043b\u0438\u0442\u0435 &#171;\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e ip &lt;\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0430>&#187;.<\/p>\n<p>\u0412\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442? \u0418\u0434\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435!<\/p>\n<h2>\u0420\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0440\u043e\u0443\u0442\u0435\u0440\u0443 \u043f\u0440\u043e \u0441\u0435\u0440\u0432\u0435\u0440<\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0435\u0440 \u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0434\u0435\u043b\u043e \u0441 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u043c ip \u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b DHCP. \u0421\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0440\u043e\u0443\u0442\u0435\u0440\u0443, \u0447\u0442\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c \u0440\u043e\u0443\u0442\u0435\u0440\u0430 \u0432\u0431\u0438\u0432\u0430\u0435\u043c \u0432 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0435\u0433\u043e ip \u0430\u0434\u0440\u0435\u0441.<\/p>\n<p>\u0415\u0441\u0442\u044c \u0434\u0432\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430:<\/p>\n<ul>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c DMZ \u0437\u043e\u043d\u0443 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0440\u043e\u0443\u0442\u0435\u0440\u0430 \u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0442\u0443\u0434\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u042d\u0442\u0438\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043c \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u043c \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043b\u044e\u0431\u043e\u0439 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u043d\u0435\u043c\u0443.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043f\u043e\u0440\u0442\u044b \u043d\u0443\u0436\u043d\u044b\u0445 \u043d\u0430\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 \u0440\u043e\u0443\u0442\u0435\u0440 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 (\u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u0440\u0442\u043e\u0432). \u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u043f\u043e\u0440\u0442 SSH (22) \u0438 flask (5000)<\/p>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u043f\u0438\u043d\u0433\u0430\u043d\u0443\u0442\u044c \u0435\u0433\u043e \u0438\u0437 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0441\u0435\u0442\u0438. <\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u0441\u0435 \u043d\u043e\u0440\u043c? \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u0438\u0434\u0435\u043d \u0438\u0437 \u0432\u043d\u0435, \u0441\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u043e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438.<\/p>\n<h2>\u0417\u0430\u0449\u0438\u0442\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430<\/h2>\n<p>\u042f \u0431\u0443\u0434\u0443 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c <code>SSH<\/code>, <code>Firewall<\/code> \u0438 <code>fail2ban<\/code> \u043f\u043e<a href=\"https:\/\/habr.com\/ru\/company\/vdsina\/blog\/521388\/\" rel=\"noopener noreferrer nofollow\"> \u0432\u043e\u0442 \u044d\u0442\u043e\u043c\u0443<\/a> \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u0435\u043c\u0443 \u0433\u0430\u0439\u0434\u0443. (\u0435\u0449\u0435 \u0440\u0430\u0437, \u043c\u043e\u044f \u0446\u0435\u043b\u044c <strong>\u043d\u0435 \u0441\u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0438\u0442\u044c<\/strong> \u0432\u0441\u0435 \u0447\u0442\u043e \u044f \u043d\u0430\u0448\u0435\u043b, \u0430 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u0435 \u0432 \u043e\u0434\u043d\u043e \u043c\u0435\u0441\u0442\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c) \u042f \u0434\u0435\u043b\u0430\u044e \u0432\u0441\u0435 \u0434\u043b\u044f Ubuntu Server, \u043d\u043e \u0432 \u0442\u043e\u043c \u0433\u0430\u0439\u0434\u0435 \u0435\u0441\u0442\u044c \u0434\u043b\u044f CentOS \u0438 Red Hat.<\/p>\n<p>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0435\u0449\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e\u043c\u0438\u043c\u043e root (1), \u0437\u0430\u0434\u0430\u0434\u0438\u043c \u0435\u043c\u0443 \u043f\u0430\u0440\u043e\u043b\u044c (2) \u0438 \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c root \u043f\u0440\u0438\u0432\u0435\u043b\u0435\u0433\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 sudo (3):<\/p>\n<pre><code>useradd [options] &lt;username> passwd &lt;username> usermod -aG sudo &lt;username><\/code><\/pre>\n<h3>SSH<\/h3>\n<p>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0439\u0442\u0435 \u043f\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0432 <span>\u0441\u0442\u0430\u0442\u044c\u0435<\/span> \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u043e\u0439 \u0432\u044b\u0448\u0435. \u0422\u0430\u043c \u043c\u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u0447\u0435\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u043a\u0440\u043e\u043c\u0435 \u043f\u043e\u0434\u0440\u043e\u043d\u043e\u0441\u0442\u0435\u0439 \u043e public \u0438 private \u043a\u043b\u044e\u0447\u0430\u0445:<\/p>\n<ul>\n<li>\n<p><code>ssh-keygen -t rsa<\/code> \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 2 \u043a\u043b\u044e\u0447\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 (\u0442\u043e\u0442 \u0447\u0442\u043e \u0438\u043c\u0435\u0435\u0442 .<code>pub<\/code>) \u0438 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0439 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 (\u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0442\u0430\u043a\u043e\u0433\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f)<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u043a\u043b\u044e\u0447 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432 \u0444\u0430\u0439\u043b <code>authorized_keys<\/code> \u0432 \u043f\u0430\u043f\u043a\u0435 <code>\/.ssh<\/code> \u0432 \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f (<code>\/home\/username\/.shh\/authorized_key<\/code>)<\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code>cat ~\/.ssh\/id_rsa.pub | ssh root@ip-\u0430\u0434\u0440\u0435\u0441-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 'cat >> ~\/.ssh\/authorized_keys'<\/code><\/pre>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u0417\u0430\u043a\u0440\u044b\u0442\u044b\u0439 \u043a\u043b\u044e\u0447 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0441\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u0435\u0433\u043e \u043a\u0443\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c<\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u044e\u0447 \u0434\u043b\u044f \u0432\u0445\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<\/li>\n<\/ul>\n<pre><code>ssh -i &lt;\u043f\u0443\u0442\u044c \u043a \u043a\u043b\u044e\u0447\u0443> &lt;\u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f>@&lt;\u0430\u0434\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430><\/code><\/pre>\n<p><em>\u0412\u0430\u0436\u043d\u043e \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u043f\u043e \u043f\u0430\u0440\u043e\u043b\u044e \u0438\u043d\u0430\u0447\u0435 \u043c\u044b \u0432\u0441\u0435 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u043b\u0438 \u0437\u0440\u044f.<\/em><\/p>\n<h3>Firewall<\/h3>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0440\u043e\u0431\u0440\u043e\u0441 \u043f\u043e\u0440\u0442\u043e\u0432 \u043c\u044b \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u043b\u0438\u0448\u044c \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043f\u043e\u0440\u0442\u0430\u043c, \u043d\u043e DMZ \u0437\u043e\u043d\u0430 \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435 \u0442\u0438\u043f\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f DMZ \u0437\u043e\u043d\u0443 \u043d\u0430\u043c \u0441\u0442\u0440\u043e\u0438\u0442 \u043f\u043e\u0434\u043d\u044f\u0442\u044c FireWall \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435,  \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a\u0430\u043a \u0440\u0430\u0437 \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0440\u0442\u043e\u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b.<\/p>\n<p>\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 SSH (1) \u0438 \u043f\u043e\u0440\u0442\u0430 5000 (2) \u0432 ufw (Firewall), \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c Firewall (3):<\/p>\n<pre><code>sudo ufw allow ssh sudo ufw allow 5000\/tcp sudo ufw enable<\/code><\/pre>\n<p><em>\u041f\u043e\u0434\u043d\u044f\u0432 FireWall \u0432\u0430\u0436\u043d\u043e \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u043e\u0440\u0442\u0443 SSH (22) \u0438 \u043f\u043e\u0440\u0442\u0443 Flask (5000) (\u043d\u0443 \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u041f\u041e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c). \u042f \u0437\u0430\u0431\u044b\u043b \u0438 \u0434\u043e\u043b\u0433\u043e \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043b, \u043f\u043e\u0447\u0435\u043c\u0443 \u043c\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0435 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442.<\/em><\/p>\n<p>\u041d\u0430 <a href=\"https:\/\/1cloud.ru\/help\/security\/ispolzovanie-utility-ufw-na-inux\" rel=\"noopener noreferrer nofollow\">\u0441\u0430\u0439\u0442\u0435 <\/a>\u0445\u043e\u0440\u043e\u0448\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043d\u044b \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f Firewall-\u043e\u043c.<\/p>\n<h3>Fail2ban<\/h3>\n<p>Fail2ban \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u044d\u0442\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u0442 \u043f\u043e\u0434\u0431\u043e\u0440 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 SSH.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0435\u0433\u043e (1) \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c (2, 3):<\/p>\n<pre><code>sudo apt install fail2ban systemctl start fail2ban systemctl enable fail2ban<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0435\u0433\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u044d\u0442\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b:<code>\/etc\/fail2ban\/fail2ban.conf<\/code>\u00a0\u0438\u00a0<code>\/etc\/fail2ban\/jail.conf<\/code>. \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u0437\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u043a \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0432\u0440\u0435\u043c\u044f \u0431\u0430\u043d\u0430.<\/p>\n<h2>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f<\/h2>\n<ol>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c flask \u0438 python3:<\/p>\n<pre><code>sudo apt install python3 sudo apt install pip pip install flask<\/code><\/pre>\n<\/li>\n<li>\n<p>\u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u0434 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0441 <a href=\"https:\/\/flask.palletsprojects.com\/en\/2.0.x\/quickstart\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0430\u0439\u0442\u0430<\/a> \u0432 \u0444\u0430\u0439\u043b <code>server.py<\/code>:<\/p>\n<pre><code class=\"python\">from flask import Flask  app = Flask(__name__)  @app.route(\"\/\") def hello_world():     return \"&lt;p>Hello, World!&lt;\/p>\"<\/code><\/pre>\n<p>\u041d\u0430\u0445\u043e\u0434\u044f\u0441\u044c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0441 \u044d\u0442\u0438\u043c \u0444\u0430\u0439\u043b\u043e\u043c, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0441\u0435\u0440\u0432\u0435\u0440:<\/p>\n<pre><code>export FLASK_APP=server.py flask run -h &lt;\u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430> -p 5000<\/code><\/pre>\n<p>\u0421\u0435\u0440\u0432\u0435\u0440 \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u043d\u0435\u043c\u0443 \u0441 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u0440\u044f\u043c\u043e \u0447\u0435\u0440\u0435\u0437 \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435, \u0432\u0432\u043e\u0434\u044f \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0430\u0434\u0440\u0435\u0441 \u043d\u0430\u0448\u0435\u0433\u043e \u0440\u043e\u0443\u0442\u0435\u0440\u0430, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443:<\/p>\n<pre><code>94.123.45.70:5000\/<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 &#171;Hello, World!&#187;. \u041d\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e? \u041f\u0440\u043e\u0439\u0434\u0438\u0442\u0435\u0441\u044c \u043f\u043e \u043c\u043e\u0438\u043c \u0437\u0430\u043c\u0435\u0442\u043a\u0430\u043c \u0432 \u044d\u0442\u043e\u043c \u0433\u0430\u0439\u0434\u0435 \u0435\u0449\u0435 \u0440\u0430\u0437.<\/p>\n<\/li>\n<\/ol>\n<h2>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438<\/h2>\n<ul>\n<li>\n<p><a href=\"https:\/\/hackware.ru\/?p=4780\" rel=\"noopener noreferrer nofollow\">https:\/\/hackware.ru\/?p=4780<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/1cloud.ru\/help\/security\/ispolzovanie-utility-ufw-na-inux\" rel=\"noopener noreferrer nofollow\">https:\/\/1cloud.ru\/help\/security\/ispolzovanie-utility-ufw-na-inux<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/flask.palletsprojects.com\/en\/2.0.x\/quickstart\/\" rel=\"noopener noreferrer nofollow\">https:\/\/flask.palletsprojects.com\/en\/2.0.x\/quickstart\/<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/firstvds.ru\/technology\/dobavit-ssh-klyuch\" rel=\"noopener noreferrer nofollow\">https:\/\/firstvds.ru\/technology\/dobavit-ssh-klyuch<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/company\/vdsina\/blog\/521388\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/company\/vdsina\/blog\/521388\/<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/adminguide.ru\/2018\/09\/24\/ubuntu-server-18-04-%D1%83%D1%81%D1%82%D0%B0%D0%BD%D0%BE%D0%B2%D0%BA%D0%B0-%D1%81%D1%82%D0%B0%D1%82%D0%B8%D1%87%D0%B5%D1%81%D0%BA%D0%BE%D0%B3%D0%BE-ip\/\" rel=\"noopener noreferrer nofollow\">https:\/\/adminguide.ru\/2018\/09\/24\/ubuntu-server-18-04-\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430-\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e-ip\/<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/blog.sedicomm.com\/2018\/07\/22\/kak-otklyuchit-login-root-po-ssh-v-linux\/\" rel=\"noopener noreferrer nofollow\">https:\/\/blog.sedicomm.com\/2018\/07\/22\/kak-otklyuchit-login-root-po-ssh-v-linux\/<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><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:\/\/habr.com\/ru\/articles\/579924\/\"> https:\/\/habr.com\/ru\/articles\/579924\/<\/a><br \/><\/br><\/br><\/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-396926","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/396926","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=396926"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/396926\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=396926"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=396926"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=396926"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}