{"id":444143,"date":"2025-01-08T03:00:08","date_gmt":"2025-01-08T03:00:08","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=444143"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2025-01-08T03:00:08","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=444143","title":{"rendered":"<span>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c WiFi \u0432\u0440\u0443\u0447\u043d\u0443\u044e<\/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<p>\u0418 \u0441\u043d\u043e\u0432\u0430 \u0432\u0441\u043f\u043e\u043c\u043d\u044e \u0432\u0440\u0435\u043c\u0435\u043d\u0430 \u0434\u0440\u0435\u0432\u043d\u0438\u0435, \u0441\u0442\u0430\u0440\u043e\u0433\u043b\u0438\u043d\u044f\u043d\u044b\u0435: \u043a\u043e\u0433\u0434\u0430-\u0442\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0441\u0435\u0442\u0438 \u0432 UNIX-like OS \u0431\u044b\u043b\u0430 \u0434\u0435\u043b\u043e\u043c, \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u043c \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0437\u043d\u0430\u043d\u0438\u0439. \u041d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0437\u0430\u0439\u0442\u0438 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u043f\u043e\u0434 \u043f\u0440\u0430\u0432\u0430\u043c\u0438 \u0440\u0443\u0442\u043e\u0432\u044b\u043c\u0438, \u0434\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0430\u0434\u0440\u0435\u0441 IP \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e. \u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<p><code>ifconfig eth0 add inet 192.168.1.10 netmask 255.255.255.0 up<\/code><\/p>\n<p>\u0418\u043b\u0438, \u0435\u0436\u0435\u043b\u0438 \u0430\u0434\u043c\u0438\u043d \u0441\u0435\u0442\u0438 \u0441\u043f\u043e\u0434\u043e\u0431\u0438\u043b\u0441\u044f, \u0434\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b \u0441\u0435\u0440\u0432\u0435\u0440 DHCP &#8212; \u0442\u043e \u0442\u0430\u043a:<\/p>\n<p><code>ifconfig eth0 up<\/code><\/p>\n<p><code>dhclient eth0<\/code><\/p>\n<p>\u0414\u0430 \u0435\u0449\u0435 \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0430\u0434\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 DNS:<\/p>\n<p><code>echo \"nameserver 8.8.8.8\" &gt; \/etc\/resolv.conf<\/code><\/p>\n<p>\u0410 \u0435\u0436\u0435\u043b\u0438 \u043d\u0430\u0434\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u0431\u044b\u043b\u0430 \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u043e \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u043b\u043e\u0441\u044c &#8212; \u0442\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u044d\u0442\u0438 \u0437\u0430\u043a\u043b\u0438\u043d\u0430\u043d\u0438\u044f \u0432 \u0444\u0430\u0439\u043b \u0442\u0438\u043f\u0430 \/etc\/rc.local \u043d\u0430 \u043f\u0430\u043c\u044f\u0442\u044c \u0434\u043e\u043b\u0433\u0443\u044e.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c-\u0442\u043e \u0434\u0440\u0443\u0433\u043e\u0435 \u0434\u0435\u043b\u043e: \u0432\u043e\u0442\u043a\u043d\u0443\u043b \u0448\u043d\u0443\u0440\u043e\u043a \u0432 \u0440\u0430\u0437\u044a\u0435\u043c &#8212; \u0441\u0435\u0442\u044c \u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c, \u043a\u0430\u043a \u043f\u043e \u0449\u0443\u0447\u044c\u0435\u043c\u0443 \u0432\u0435\u043b\u0435\u043d\u0438\u044e.<br \/>\u0418 \u0434\u0430\u0436\u0435 WiFi &#8212; \u043d\u0430\u0436\u0430\u043b \u043c\u044b\u0448\u043a\u043e\u0439 \u043d\u0430 \u0438\u043a\u043e\u043d\u043a\u0443, \u0432\u044b\u0431\u0440\u0430\u043b \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u0435\u0442\u0438, \u0432\u0432\u0435\u043b \u043f\u0430\u0440\u043e\u043b\u044c &#8212; \u043e\u043d\u0430 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b\u0430\u0441\u044c.<br \/>\u041a\u0440\u0430\u0441\u043e\u0442\u0430, \u043b\u0435\u043f\u043e\u0442\u0430 \u043a\u0430\u043a\u0430\u044f! \u041d\u043e \u0435\u0441\u0442\u044c \u043d\u044e\u0430\u043d\u0441&#8230;<\/p>\n<p>\u0417\u0430 \u0432\u0441\u044e \u044d\u0442\u0443 \u043a\u0440\u0430\u0441\u043e\u0442\u0443 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0442\u0435\u043f\u0435\u0440\u044c NetworkManager (\u044f \u043f\u0440\u043e Ubuntu \u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435). \u041e\u043d \u0441\u0442\u0430\u0440\u0442\u0443\u0435\u0442 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430, \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u043c\u0438. \u0414\u0430 \u0438 \u0441 \/etc\/resolv.conf \u0432\u0441\u0435 \u043d\u0435 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e, \u0442\u0435\u043f\u0435\u0440\u044c \u044d\u0442\u0438\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0440\u0443\u0433\u043e\u0439 \u0434\u0435\u043c\u043e\u043d, \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u044f \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a DNS.<\/p>\n<p>\u0412\u0441\u0451\u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u043a\u0430 \u0432\u044b \u043d\u0435\u00a0\u0432\u044b\u0445\u043e\u0434\u0438\u0442\u0435 \u0437\u0430\u00a0\u0440\u0430\u043c\u043a\u0438 \u043f\u0440\u0435\u0434\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u0430, \u0432\u00a0\u0441\u043c\u044b\u0441\u043b\u0435, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u044b.<br \/>\u041d\u043e\u00a0\u0441\u0442\u043e\u0438\u0442 \u0447\u0442\u043e\u2011\u0442\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c\u00a0\u2014 \u0438 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u00a0\u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043a\u0443\u0434\u0430 \u0442\u044b\u043a\u0430\u0442\u044c \u043c\u044b\u0448\u043a\u043e\u0439, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e\u00a0\u0438\u043a\u043e\u043d\u043a\u0438 \u043d\u0435\u0442. \u0410\u00a0\u043d\u0435\u0442 \u0435\u0435 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e\u00a0\u0430\u043f\u043f\u043b\u0435\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u00a0\u043d\u0435\u0435 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442, \u043d\u0435\u00a0\u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d \u043d\u0430\u00a0\u0434\u0440\u0443\u0433\u0443\u044e \u0441\u0440\u0435\u0434\u0443, \u0438\u043b\u0438 \u00ab\u043d\u0435 \u0443\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a\u00a0DBus\u00bb, \u0438\u043b\u0438\u00a0\u043e\u043d\u043e \u043a\u0430\u043a\u00a0\u0431\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u00a0\u2014 \u043d\u043e\u00a0\u043f\u043e\u0447\u0435\u043c\u0443\u2011\u0442\u043e \u043d\u0435\u00a0\u0442\u0430\u043a \u043a\u0430\u043a\u00a0\u043e\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0418 \u043a\u0430\u043a\u00a0\u0431\u044b \u0435\u0441\u0442\u044c \u0434\u0430\u0436\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 nmcli, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u00a0NetworkManager, \u043d\u043e\u00a0\u0441\u00a0\u043d\u0438\u043c \u0442\u043e\u0436\u0435 \u0432\u0441\u0451 \u043d\u0435\u00a0\u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e\u00a0\u0432\u0441\u044f \u044d\u0442\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432\u00a0\u043d\u0435\u0448\u0442\u0430\u0442\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, \u0432\u0441\u0451 \u044d\u0442\u043e \u043f\u043e\u2011\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u0438 \u0434\u0430\u0436\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0431\u0435\u0437\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432.<br \/>(\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u0442\u043c\u0435\u0447\u0443, \u0447\u0442\u043e\u00a0\u043d\u0435\u00a0\u0441\u0442\u043e\u0438\u0442 \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u043e\u0431\u044a\u044f\u0442\u044c \u043d\u0435\u043e\u0431\u044a\u044f\u0442\u043d\u043e\u0435 \u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 NetworkManager)<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u0432\u0440\u0443\u0447\u043d\u0443\u044e.<br \/>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u043c NetworkManager \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043d\u0435 \u043c\u0435\u0448\u0430\u043b:<\/p>\n<p><code>systemctl stop NetworkManager<\/code><\/p>\n<p><code>systemctl disable NetworkManager<\/code><\/p>\n<p>\u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 &#8212; \u0442\u0443\u0442 \u043c\u0430\u043b\u043e \u0447\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c, \u0440\u0430\u0437\u0432\u0435 \u0447\u0442\u043e \u0432\u043c\u0435\u0441\u0442\u043e ifconfig \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0434\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c ip:<\/p>\n<p><code>ip link set eth0 up<\/code><\/p>\n<p><code>ip addr add 192.168.1.10 dev eth0<\/code> <\/p>\n<p>\u0410 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 WiFi \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u0440\u0443\u0433\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b (iwconfig \u0438\u043b\u0438 iw):<\/p>\n<p><code>iwconfig<\/code><\/p>\n<p><code>lo        no wireless extensions.<\/code><\/p>\n<p><code>wlp2s0    IEEE 802.11  ESSID:off\/any<\/code><\/p>\n<p><code>Mode:Managed  Access Point: Not-Associated   Tx-Power=22 dBm<\/code><\/p>\n<p><code>Retry short limit:7   RTS thr:off   Fragment thr:off<\/code><\/p>\n<p><code>Power Management:on<\/code><\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u044b \u0434\u0432\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430, \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0431\u0435\u0437 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 WiFi \u0438 wlp2s0<br \/>\u0423\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u043e\u043d \u043f\u043e\u0434\u043d\u044f\u0442 \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u0441\u0435\u0442\u0438:<\/p>\n<p><code>ip link set wlp2s0 up<\/code><\/p>\n<p><code>iwlist wlp2s0 scan | grep ESSID<\/code><\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u0430\u0448\u0430 \u0441\u0435\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0434\u043b\u044f \u0437\u0430\u0449\u0438\u0442\u044b WPA\/WPA2, \u0434\u0440\u0443\u0433\u0438\u0435 \u0432 \u043d\u0430\u0448\u0435 \u0432\u0440\u0435\u043c\u044f \u044d\u043a\u0437\u043e\u0442\u0438\u043a\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f wpa_supplicant.<br \/>\u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0441\u0435\u0442\u044c\u044e \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0441 \u0442\u0430\u043a\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435\u043c:<\/p>\n<pre><code class=\"bash\">network={   ssid=\"[network ssid]\"   psk=\"[the passphrase]\"   priority=1 }<\/code><\/pre>\n<p>\u0412\u043e\u043e\u0431\u0449\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u0432 \u043e\u0434\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439, \u043d\u043e \u0435\u0441\u043b\u0438 \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u043e\u0442\u043e\u043c \u0441\u044e\u0440\u043f\u0440\u0438\u0437\u043e\u0432 \u0441 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u043c\u0438 &#8212; \u043b\u0443\u0447\u0448\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c\u0441\u044f \u043e\u0434\u043d\u043e\u0439, \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0435\u0435 \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438.<br \/>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0430\u043c wpa_supplicant \u0438 dhclient:<\/p>\n<p><code>wpa_supplicant -B -i wlp2s0 -c \/etc\/wpa_supplicant\/wpa_supplicant_XXXX.conf<\/code><\/p>\n<p><code>dhclient wlp2s0<\/code><\/p>\n<p>\u0412 \u0442\u0438\u043f\u043e\u0432\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e. \u0415\u0441\u043b \u0432\u0441\u0451 \u0431\u044b\u043b\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e &#8212; \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0441\u044f \u043a \u0441\u0435\u0442\u0438 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u0430\u0434\u0440\u0435\u0441.<\/p>\n<p>\u041d\u043e \u044d\u0442\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u0442\u043e \u0435\u0441\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u044c, \u0441 \u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u0444\u0430\u0439\u043b\u043e\u0432. \u0414\u043b\u044f \u0441\u0442\u0430\u0446\u0438\u043e\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u043f\u043e\u0439\u0434\u0435\u0442, \u0434\u043b\u044f \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0430 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0431\u0440\u043e\u0441\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438.<\/p>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0432\u0437\u044f\u0442\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u0442\u0430\u0440\u0438\u043d\u043d\u0430\u044f \u043f\u0430\u0440\u043e\u0447\u043a\u0430 tcl\/tk, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0438 \u043e\u0442 \u0431\u043e\u043b\u0435\u0435 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043d\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043a \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c, \u043a \u0442\u043e\u043c\u0443 \u0436\u0435 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u044e\u0449\u0430\u044f\u0441\u044f \u0432 \u043e\u0431\u044b\u0447\u043d\u044b\u0435 shell-\u0441\u043a\u0440\u0438\u043f\u0442\u044b. \u0415\u0441\u043b\u0438 \u0432\u0434\u0440\u0443\u0433 \u044d\u0442\u0438\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e &#8212; \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0445 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u0442\u0430\u043c \u0432\u0441\u0435\u0433\u043e-\u0442\u043e \u043f\u0430\u0440\u0430 \u043c\u0435\u0433\u0430\u0431\u0430\u0439\u0442:<\/p>\n<p><code>apt install tcl tk<\/code><\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 NetworkManager &#8212; \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u043c\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u043e\u043d \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0447\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432\u044b\u0448\u0435, \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 \u043e\u043a\u043e\u0448\u043a\u0438.<\/p>\n<pre><code class=\"bash\">#!\/bin\/bash  # \u043e\u043a\u043d\u043e \u0432\u0432\u043e\u0434\u0430 \u043f\u0430\u0440\u043e\u043b\u044f ask_pass() {  getpwd=\" package require Tk  # \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043e\u043a\u043d\u0430 wm title . \\\"$1\\\" wm geometry . +300+50 wm protocol . WM_DELETE_WINDOW { exit }  # \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0438 \u0441\u0442\u0440\u043e\u043a\u0430 \u0432\u0432\u043e\u0434\u0430 \u0441\u043e \u0437\u0432\u0435\u0437\u0434\u043e\u0447\u043a\u0430\u043c\u0438 label .label -text \\\"$1:\\\" -padx 10 -pady 10 pack .label -side top entry .entry -width 30 -show * -textvariable userInput pack .entry -side top -padx 10 -pady 5 set userInput \\\"\\\"  # \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 proc onOk {} {     global userInput     puts stdout \\$userInput     exit }  # \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u0438 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0435\u0435 \u0432 \u043e\u043a\u043d\u0435 button .okButton -text \\\"OK\\\" -command onOk -padx 10 -pady 5 pack .okButton -side top -padx 10 -pady 10  # \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435 \u0432\u0432\u043e\u0434\u0430 vwait userInput \"   echo \"$getpwd\" | wish }  # \u043e\u043a\u043d\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f message() {  str=\" package require Tk  # \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043e\u043a\u043d\u0430 wm title . \\\"$1\\\" wm geometry . +300+50 wm minsize . 300x150 wm protocol . WM_DELETE_WINDOW { exit }  # \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435  label .label -text \\\"$1\\\" -padx 10 -pady 30 pack .label -side top  # \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 proc onOk {} {     exit }  # \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u0438 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0435\u0435 \u0432 \u043e\u043a\u043d\u0435 button .okButton -text \\\"OK\\\" -command onOk -padx 10 -pady 5 pack .okButton -side top -padx 10 -pady 5  \"   echo \"$str\" | wish }  # \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0441\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u0441\u0443\u043f\u0435\u0440\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438\u043b\u0438 \u043d\u0435\u0442 if [[ $EUID -ne 0 ]]; then    # \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0434\u0435\u043b\u0430\u043b\u043e\u0441\u044c \u043b\u0438 sudo   sudo -n true &gt; \/dev\/null 2&gt;&amp;1   if [ $? -ne 0 ] ; then     passwd=`ask_pass \"User password\"`      if [ ! -n \"$passwd\" ] ; then       message \"No password!\"       exit 1     fi      echo $passwd | sudo -S true &gt; \/dev\/null 2&gt;&amp;1     if [ $? -ne 0 ] ; then       message \"Incorrect password!\"       exit 2     fi   fi fi  # \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 WiFi interfaces=$(iwconfig 2&gt;\/dev\/null | awk '\/IEEE\/ {print $1 \"=\" $4}') if [[ -z \"$interfaces\" ]]; then   echo \"No WiFi found\" &gt;&amp;2   exit 3 fi  # \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0438 AP temp_file=$(mktemp) trap \"rm -f $temp_file\" EXIT  for iface in $interfaces; do   echo \"$iface\" &gt;&gt; \"$temp_file\" done  iface=''  # \u0432\u044b\u0432\u043e\u0434 \u043e\u043a\u043d\u0430 \u0441\u043f\u0438\u0441\u043a\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 select_iface() {  getiface=\" package require Tk wm title . \\\"Select interface\\\" wm geometry . +300+50 wm protocol . WM_DELETE_WINDOW { exit }  label .l1 -text \\\"Select interface\\\" pack .l1 -padx 10 -pady 5  listbox .list1 -width 50 -height 3 pack .list1 -padx 10 -pady 5  # \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 set fd [open \\\"$temp_file\\\" r] set lines [split [read \\$fd] \\\"\\\\n\\\"] close \\$fd  foreach line \\$lines {   if {[regexp {(\\\\w+)=ESSID:([\\\"\\\\w]+)} \\$line match iface essid]} {     .list1 insert end \\\"\\$iface (\\$essid)\\\"   } }  # \u043a\u043d\u043e\u043f\u043a\u0430 \u0432\u044b\u0431\u043e\u0440\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 button .ok -text \\\"Select interface\\\" -command {   set selection [.list1 get [.list1 curselection]]   if {[regexp {(\\\\w+) } \\$selection match iface]} {     set selected_iface \\$iface     puts stdout \\\"\\$selected_iface\\\"     exit   } } pack .ok -padx 10 -pady 5  set selected_iface \\\"\\\"  vwait selected_iface  \"    echo \"$getiface\" | wish  }  # \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 iface=`select_iface`  # \u0432\u044b\u0432\u043e\u0434 \u043e\u043a\u043d\u0430 \u0441\u043f\u0438\u0441\u043a\u0430 \u0441\u0435\u0442\u0435\u0439 select_network() {  getnet=\" package require Tk wm title . \\\"Select network\\\" wm geometry . +300+50 wm protocol . WM_DELETE_WINDOW { exit }  label .l1 -text \\\"Select network\\\" pack .l1 -padx 10 -pady 5  listbox .list -width 50 -height 20 pack .list -padx 10 -pady 5  # \u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 set fd [open \\\"$temp_file\\\" r] set lines [split [read \\$fd] \\\"\\\\n\\\"] close \\$fd  foreach line \\$lines {   if {[regexp {(\\\\w+)} \\$line match essid]} {     .list insert end \\\"\\$essid\\\"   } }  button .ok -text \\\"Select\\\" -command {   set selection [.list get [.list curselection]]   set selected_net \\$selection   puts stdout \\\"\\$selected_net\\\"   exit }  pack .ok -padx 10 -pady 5  set selected_net \\\"\\\"  vwait selected_net  \"    echo \"$getnet\" | wish  }  # \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0435\u0442\u0435\u0439 scan_networks() {   sudo ip link set $1 up   echo -n \"\" &gt; \"$temp_file\"   echo \"Scan...\"   sudo iwlist $1 scan | grep -E 'ESSID|Signal level' | awk -F: '{print $2}' | sort | uniq &gt;&gt; \"$temp_file\" }  # \u0435\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432\u044b\u0431\u0440\u0430\u043d - \u0441\u043a\u0430\u043d\u0438\u0440\u0443\u0435\u043c \u0441\u0435\u0442\u0438 \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0438\u0437 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 if [ -n \"$iface\" ] ; then    scan_networks $iface    net=`select_network`    if [ -n \"$net\" ] ; then     key=`ask_pass \"WiFi password\"`     if [ -n \"$key\" ] ; then        # \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0434\u043b\u044f wpa_supplicant       conf=\" update_config=1  network={     ssid=\\\"$net\\\"     psk=\\\"$key\\\" } \"       sudo mkdir -p \/etc\/wpa_supplicant       file=\/etc\/wpa_supplicant\/wpa_supplicant_$iface.conf        # \u0448\u0430\u043c\u0430\u043d\u0441\u0442\u0432\u043e \u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u0444\u0430\u0439\u043b\u0430       sudo touch $file       sudo chmod 666 $file       sudo echo \"$conf\" &gt; $file       sudo chmod 644 $file        # \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c wpa_supplicant       pid=`ps ax| grep \"wpa_supplicant\" | grep -v grep | grep \"$iface\" | awk '{print $1}'`       if [ \"x$pid\" != \"x\" ]; then         sudo kill $pid       fi        pid=`ps ax| grep \"dhclient $iface\" | grep -v grep | awk '{print $1}'`       if [ \"x$pid\" != \"x\" ]; then         sudo kill $pid       fi        sudo wpa_supplicant -B -i \"$iface\" -c \/etc\/wpa_supplicant\/wpa_supplicant_$iface.conf         # \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c IP-\u0430\u0434\u0440\u0435\u0441 \u0447\u0435\u0440\u0435\u0437 DHCP       sudo dhclient \"$iface\"        msg=`ip addr show dev $iface | grep inet | awk '{print $1 \" \" $2 }'`       message \"$msg\"      else       message \"No WiFi password!\"     fi   else     message \"No network selected!\"   fi else   message \"No interface selected!\" fi  exit #===================================================== <\/code><\/pre>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u043f\u043e\u0434\u00a0\u043a\u0435\u043c \u043e\u043d \u0437\u0430\u043f\u0443\u0449\u0435\u043d, \u0435\u0441\u043b\u0438 \u043f\u043e\u0434\u00a0\u043e\u0431\u044b\u0447\u043d\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c\u00a0\u2014 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u043f\u0430\u0440\u043e\u043b\u044c \u0434\u043b\u044f\u00a0sudo, \u0437\u0430\u0442\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0441\u00a0WiFi (\u0438\u0445 \u043c\u043e\u0436\u0435\u0442\u00a0\u0431\u044b\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e), \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0431\u043e\u0440\u0430 \u0441\u043a\u0430\u043d\u0438\u0440\u0443\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0441\u0435\u0442\u0438, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u0442\u044c, \u043f\u043e\u0442\u043e\u043c \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u043d\u0444\u0438\u0433 \u0434\u043b\u044f\u00a0\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 wpa_supplicant. \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u043f\u0440\u043e\u0448\u043b\u043e \u0445\u043e\u0440\u043e\u0448\u043e\u00a0\u2014 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 IP\u2011\u0430\u0434\u0440\u0435\u0441\u0430 \u043d\u0430\u00a0\u044d\u0442\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435.<\/p>\n<p>\u0414\u043b\u044f\u00a0\u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043d\u0435\u00a0\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0432\u0441\u0451 \u044d\u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438\u00a0\u2014 \u0435\u0441\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u043e\u0442\u00a0\u0440\u0443\u0442\u0430 \u043f\u0440\u0438\u00a0\u0441\u0442\u0430\u0440\u0442\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b:<\/p>\n<pre><code class=\"bash\">#!\/bin\/sh  for i in \/etc\/wpa_supplicant\/wpa_supplicant_*.conf; do   iface=`echo $i | sed -nE \"s\/^.*wpa_supplicant_(.+)\\.conf\/\\1\/p\"`   if [ -n \"$iface\" ] ; then     ip link set $iface up     wpa_supplicant -B -i \"$iface\" -c \/etc\/wpa_supplicant\/wpa_supplicant_$iface.conf     dhclient \"$iface\"   fi done <\/code><\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u0432 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 wpa_supplicant \u0441 \u043d\u0438\u043c\u0438.<\/p>\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\/871612\/\"> https:\/\/habr.com\/ru\/articles\/871612\/<\/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<p>\u0418 \u0441\u043d\u043e\u0432\u0430 \u0432\u0441\u043f\u043e\u043c\u043d\u044e \u0432\u0440\u0435\u043c\u0435\u043d\u0430 \u0434\u0440\u0435\u0432\u043d\u0438\u0435, \u0441\u0442\u0430\u0440\u043e\u0433\u043b\u0438\u043d\u044f\u043d\u044b\u0435: \u043a\u043e\u0433\u0434\u0430-\u0442\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0441\u0435\u0442\u0438 \u0432 UNIX-like OS \u0431\u044b\u043b\u0430 \u0434\u0435\u043b\u043e\u043c, \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u043c \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0437\u043d\u0430\u043d\u0438\u0439. \u041d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0437\u0430\u0439\u0442\u0438 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u043f\u043e\u0434 \u043f\u0440\u0430\u0432\u0430\u043c\u0438 \u0440\u0443\u0442\u043e\u0432\u044b\u043c\u0438, \u0434\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0430\u0434\u0440\u0435\u0441 IP \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e. \u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<p><code>ifconfig eth0 add inet 192.168.1.10 netmask 255.255.255.0 up<\/code><\/p>\n<p>\u0418\u043b\u0438, \u0435\u0436\u0435\u043b\u0438 \u0430\u0434\u043c\u0438\u043d \u0441\u0435\u0442\u0438 \u0441\u043f\u043e\u0434\u043e\u0431\u0438\u043b\u0441\u044f, \u0434\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b \u0441\u0435\u0440\u0432\u0435\u0440 DHCP &#8212; \u0442\u043e \u0442\u0430\u043a:<\/p>\n<p><code>ifconfig eth0 up<\/code><\/p>\n<p><code>dhclient eth0<\/code><\/p>\n<p>\u0414\u0430 \u0435\u0449\u0435 \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0430\u0434\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 DNS:<\/p>\n<p><code>echo \"nameserver 8.8.8.8\" &gt; \/etc\/resolv.conf<\/code><\/p>\n<p>\u0410 \u0435\u0436\u0435\u043b\u0438 \u043d\u0430\u0434\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u0431\u044b\u043b\u0430 \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u043e \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u043b\u043e\u0441\u044c &#8212; \u0442\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u044d\u0442\u0438 \u0437\u0430\u043a\u043b\u0438\u043d\u0430\u043d\u0438\u044f \u0432 \u0444\u0430\u0439\u043b \u0442\u0438\u043f\u0430 \/etc\/rc.local \u043d\u0430 \u043f\u0430\u043c\u044f\u0442\u044c \u0434\u043e\u043b\u0433\u0443\u044e.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c-\u0442\u043e \u0434\u0440\u0443\u0433\u043e\u0435 \u0434\u0435\u043b\u043e: \u0432\u043e\u0442\u043a\u043d\u0443\u043b \u0448\u043d\u0443\u0440\u043e\u043a \u0432 \u0440\u0430\u0437\u044a\u0435\u043c &#8212; \u0441\u0435\u0442\u044c \u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c, \u043a\u0430\u043a \u043f\u043e \u0449\u0443\u0447\u044c\u0435\u043c\u0443 \u0432\u0435\u043b\u0435\u043d\u0438\u044e.<br \/>\u0418 \u0434\u0430\u0436\u0435 WiFi &#8212; \u043d\u0430\u0436\u0430\u043b \u043c\u044b\u0448\u043a\u043e\u0439 \u043d\u0430 \u0438\u043a\u043e\u043d\u043a\u0443, \u0432\u044b\u0431\u0440\u0430\u043b \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u0435\u0442\u0438, \u0432\u0432\u0435\u043b \u043f\u0430\u0440\u043e\u043b\u044c &#8212; \u043e\u043d\u0430 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b\u0430\u0441\u044c.<br \/>\u041a\u0440\u0430\u0441\u043e\u0442\u0430, \u043b\u0435\u043f\u043e\u0442\u0430 \u043a\u0430\u043a\u0430\u044f! \u041d\u043e \u0435\u0441\u0442\u044c \u043d\u044e\u0430\u043d\u0441&#8230;<\/p>\n<p>\u0417\u0430 \u0432\u0441\u044e \u044d\u0442\u0443 \u043a\u0440\u0430\u0441\u043e\u0442\u0443 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0442\u0435\u043f\u0435\u0440\u044c NetworkManager (\u044f \u043f\u0440\u043e Ubuntu \u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435). \u041e\u043d \u0441\u0442\u0430\u0440\u0442\u0443\u0435\u0442 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430, \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u043c\u0438. \u0414\u0430 \u0438 \u0441 \/etc\/resolv.conf \u0432\u0441\u0435 \u043d\u0435 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e, \u0442\u0435\u043f\u0435\u0440\u044c \u044d\u0442\u0438\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0440\u0443\u0433\u043e\u0439 \u0434\u0435\u043c\u043e\u043d, \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u044f \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a DNS.<\/p>\n<p>\u0412\u0441\u0451\u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u043a\u0430 \u0432\u044b \u043d\u0435\u00a0\u0432\u044b\u0445\u043e\u0434\u0438\u0442\u0435 \u0437\u0430\u00a0\u0440\u0430\u043c\u043a\u0438 \u043f\u0440\u0435\u0434\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u0430, \u0432\u00a0\u0441\u043c\u044b\u0441\u043b\u0435, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u044b.<br \/>\u041d\u043e\u00a0\u0441\u0442\u043e\u0438\u0442 \u0447\u0442\u043e\u2011\u0442\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c\u00a0\u2014 \u0438 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u00a0\u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043a\u0443\u0434\u0430 \u0442\u044b\u043a\u0430\u0442\u044c \u043c\u044b\u0448\u043a\u043e\u0439, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e\u00a0\u0438\u043a\u043e\u043d\u043a\u0438 \u043d\u0435\u0442. \u0410\u00a0\u043d\u0435\u0442 \u0435\u0435 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e\u00a0\u0430\u043f\u043f\u043b\u0435\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u00a0\u043d\u0435\u0435 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442, \u043d\u0435\u00a0\u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d \u043d\u0430\u00a0\u0434\u0440\u0443\u0433\u0443\u044e \u0441\u0440\u0435\u0434\u0443, \u0438\u043b\u0438 \u00ab\u043d\u0435 \u0443\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a\u00a0DBus\u00bb, \u0438\u043b\u0438\u00a0\u043e\u043d\u043e \u043a\u0430\u043a\u00a0\u0431\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u00a0\u2014 \u043d\u043e\u00a0\u043f\u043e\u0447\u0435\u043c\u0443\u2011\u0442\u043e \u043d\u0435\u00a0\u0442\u0430\u043a \u043a\u0430\u043a\u00a0\u043e\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0418 \u043a\u0430\u043a\u00a0\u0431\u044b \u0435\u0441\u0442\u044c \u0434\u0430\u0436\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 nmcli, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u00a0NetworkManager, \u043d\u043e\u00a0\u0441\u00a0\u043d\u0438\u043c \u0442\u043e\u0436\u0435 \u0432\u0441\u0451 \u043d\u0435\u00a0\u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e\u00a0\u0432\u0441\u044f \u044d\u0442\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432\u00a0\u043d\u0435\u0448\u0442\u0430\u0442\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, \u0432\u0441\u0451 \u044d\u0442\u043e \u043f\u043e\u2011\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u0438 \u0434\u0430\u0436\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0431\u0435\u0437\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432.<br \/>(\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u0442\u043c\u0435\u0447\u0443, \u0447\u0442\u043e\u00a0\u043d\u0435\u00a0\u0441\u0442\u043e\u0438\u0442 \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u043e\u0431\u044a\u044f\u0442\u044c \u043d\u0435\u043e\u0431\u044a\u044f\u0442\u043d\u043e\u0435 \u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 NetworkManager)<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u0432\u0440\u0443\u0447\u043d\u0443\u044e.<br \/>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u043c NetworkManager \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043d\u0435 \u043c\u0435\u0448\u0430\u043b:<\/p>\n<p><code>systemctl stop NetworkManager<\/code><\/p>\n<p><code>systemctl disable NetworkManager<\/code><\/p>\n<p>\u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 &#8212; \u0442\u0443\u0442 \u043c\u0430\u043b\u043e \u0447\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c, \u0440\u0430\u0437\u0432\u0435 \u0447\u0442\u043e \u0432\u043c\u0435\u0441\u0442\u043e ifconfig \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0434\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c ip:<\/p>\n<p><code>ip link set eth0 up<\/code><\/p>\n<p><code>ip addr add 192.168.1.10 dev eth0<\/code> <\/p>\n<p>\u0410 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 WiFi \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u0440\u0443\u0433\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b (iwconfig \u0438\u043b\u0438 iw):<\/p>\n<p><code>iwconfig<\/code><\/p>\n<p><code>lo        no wireless extensions.<\/code><\/p>\n<p><code>wlp2s0    IEEE 802.11  ESSID:off\/any<\/code><\/p>\n<p><code>Mode:Managed  Access Point: Not-Associated   Tx-Power=22 dBm<\/code><\/p>\n<p><code>Retry short limit:7   RTS thr:off   Fragment thr:off<\/code><\/p>\n<p><code>Power Management:on<\/code><\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u044b \u0434\u0432\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430, \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0431\u0435\u0437 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 WiFi \u0438 wlp2s0<br \/>\u0423\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u043e\u043d \u043f\u043e\u0434\u043d\u044f\u0442 \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u0441\u0435\u0442\u0438:<\/p>\n<p><code>ip link set wlp2s0 up<\/code><\/p>\n<p><code>iwlist wlp2s0 scan | grep ESSID<\/code><\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u0430\u0448\u0430 \u0441\u0435\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0434\u043b\u044f \u0437\u0430\u0449\u0438\u0442\u044b WPA\/WPA2, \u0434\u0440\u0443\u0433\u0438\u0435 \u0432 \u043d\u0430\u0448\u0435 \u0432\u0440\u0435\u043c\u044f \u044d\u043a\u0437\u043e\u0442\u0438\u043a\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f wpa_supplicant.<br \/>\u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0441\u0435\u0442\u044c\u044e \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0441 \u0442\u0430\u043a\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435\u043c:<\/p>\n<pre><code class=\"bash\">network={   ssid=\"[network ssid]\"   psk=\"[the passphrase]\"   priority=1 }<\/code><\/pre>\n<p>\u0412\u043e\u043e\u0431\u0449\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u0432 \u043e\u0434\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439, \u043d\u043e \u0435\u0441\u043b\u0438 \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u043e\u0442\u043e\u043c \u0441\u044e\u0440\u043f\u0440\u0438\u0437\u043e\u0432 \u0441 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u043c\u0438 &#8212; \u043b\u0443\u0447\u0448\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c\u0441\u044f \u043e\u0434\u043d\u043e\u0439, \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0435\u0435 \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438.<br \/>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0430\u043c wpa_supplicant \u0438 dhclient:<\/p>\n<p><code>wpa_supplicant -B -i wlp2s0 -c \/etc\/wpa_supplicant\/wpa_supplicant_XXXX.conf<\/code><\/p>\n<p><code>dhclient wlp2s0<\/code><\/p>\n<p>\u0412 \u0442\u0438\u043f\u043e\u0432\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e. \u0415\u0441\u043b \u0432\u0441\u0451 \u0431\u044b\u043b\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e &#8212; \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0441\u044f \u043a \u0441\u0435\u0442\u0438 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u0430\u0434\u0440\u0435\u0441.<\/p>\n<p>\u041d\u043e \u044d\u0442\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u0442\u043e \u0435\u0441\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u044c, \u0441 \u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u0444\u0430\u0439\u043b\u043e\u0432. \u0414\u043b\u044f \u0441\u0442\u0430\u0446\u0438\u043e\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u043f\u043e\u0439\u0434\u0435\u0442, \u0434\u043b\u044f \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0430 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0431\u0440\u043e\u0441\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438.<\/p>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0432\u0437\u044f\u0442\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u0442\u0430\u0440\u0438\u043d\u043d\u0430\u044f \u043f\u0430\u0440\u043e\u0447\u043a\u0430 tcl\/tk, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0438 \u043e\u0442 \u0431\u043e\u043b\u0435\u0435 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043d\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043a \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c, \u043a \u0442\u043e\u043c\u0443 \u0436\u0435 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u044e\u0449\u0430\u044f\u0441\u044f \u0432 \u043e\u0431\u044b\u0447\u043d\u044b\u0435 shell-\u0441\u043a\u0440\u0438\u043f\u0442\u044b. \u0415\u0441\u043b\u0438 \u0432\u0434\u0440\u0443\u0433 \u044d\u0442\u0438\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e &#8212; \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0445 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u0442\u0430\u043c \u0432\u0441\u0435\u0433\u043e-\u0442\u043e \u043f\u0430\u0440\u0430 \u043c\u0435\u0433\u0430\u0431\u0430\u0439\u0442:<\/p>\n<p><code>apt install tcl tk<\/code><\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 NetworkManager &#8212; \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u043c\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u043e\u043d \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0447\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432\u044b\u0448\u0435, \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 \u043e\u043a\u043e\u0448\u043a\u0438.<\/p>\n<pre><code class=\"bash\">#!\/bin\/bash  # \u043e\u043a\u043d\u043e \u0432\u0432\u043e\u0434\u0430 \u043f\u0430\u0440\u043e\u043b\u044f ask_pass() {  getpwd=\" package require Tk  # \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043e\u043a\u043d\u0430 wm title . \\\"$1\\\" wm geometry . +300+50 wm protocol . WM_DELETE_WINDOW { exit }  # \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0438 \u0441\u0442\u0440\u043e\u043a\u0430 \u0432\u0432\u043e\u0434\u0430 \u0441\u043e \u0437\u0432\u0435\u0437\u0434\u043e\u0447\u043a\u0430\u043c\u0438 label .label -text \\\"$1:\\\" -padx 10 -pady 10 pack .label -side top entry .entry -width 30 -show * -textvariable userInput pack .entry -side top -padx 10 -pady 5 set userInput \\\"\\\"  # \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 proc onOk {} {     global userInput     puts stdout \\$userInput     exit }  # \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u0438 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0435\u0435 \u0432 \u043e\u043a\u043d\u0435 button .okButton -text \\\"OK\\\" -command onOk -padx 10 -pady 5 pack .okButton -side top -padx 10 -pady 10  # \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435 \u0432\u0432\u043e\u0434\u0430 vwait userInput \"   echo \"$getpwd\" | wish }  # \u043e\u043a\u043d\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f message() {  str=\" package require Tk  # \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043e\u043a\u043d\u0430 wm title . \\\"$1\\\" wm geometry . +300+50 wm minsize . 300x150 wm protocol . WM_DELETE_WINDOW { exit }  # \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435  label .label -text \\\"$1\\\" -padx 10 -pady 30 pack .label -side top  # \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 proc onOk {} {     exit }  # \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u0438 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0435\u0435 \u0432 \u043e\u043a\u043d\u0435 button .okButton -text \\\"OK\\\" -command onOk -padx 10 -pady 5 pack .okButton -side top -padx 10 -pady 5  \"   echo \"$str\" | wish }  # \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0441\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u0441\u0443\u043f\u0435\u0440\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438\u043b\u0438 \u043d\u0435\u0442 if [[ $EUID -ne 0 ]]; then    # \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0434\u0435\u043b\u0430\u043b\u043e\u0441\u044c \u043b\u0438 sudo   sudo -n true &gt; \/dev\/null 2&gt;&amp;1   if [ $? -ne 0 ] ; then     passwd=`ask_pass \"User password\"`      if [ ! -n \"$passwd\" ] ; then       message \"No password!\"       exit 1     fi      echo $passwd | sudo -S true &gt; \/dev\/null 2&gt;&amp;1     if [ $? -ne 0 ] ; then       message \"Incorrect password!\"       exit 2     fi   fi fi  # \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 WiFi interfaces=$(iwconfig 2&gt;\/dev\/null | awk '\/IEEE\/ {print $1 \"=\" $4}') if [[ -z \"$interfaces\" ]]; then   echo \"No WiFi found\" &gt;&amp;2   exit 3 fi  # \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0438 AP temp_file=$(mktemp) trap \"rm -f $temp_file\" EXIT  for iface in $interfaces; do   echo \"$iface\" &gt;&gt; \"$temp_file\" done  iface=''  # \u0432\u044b\u0432\u043e\u0434 \u043e\u043a\u043d\u0430 \u0441\u043f\u0438\u0441\u043a\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 select_iface() {  getiface=\" package require Tk wm title . \\\"Select interface\\\" wm geometry . +300+50 wm protocol . WM_DELETE_WINDOW { exit }  label .l1 -text \\\"Select interface\\\" pack .l1 -padx 10 -pady 5  listbox .list1 -width 50 -height 3 pack .list1 -padx 10 -pady 5  # \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 set fd [open \\\"$temp_file\\\" r] set lines [split [read \\$fd] \\\"\\\\n\\\"] close \\$fd  foreach line \\$lines {   if {[regexp {(\\\\w+)=ESSID:([\\\"\\\\w]+)} \\$line match iface essid]} {     .list1 insert end \\\"\\$iface (\\$essid)\\\"   } }  # \u043a\u043d\u043e\u043f\u043a\u0430 \u0432\u044b\u0431\u043e\u0440\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 button .ok -text \\\"Select interface\\\" -command {   set selection [.list1 get [.list1 curselection]]   if {[regexp {(\\\\w+) } \\$selection match iface]} {     set selected_iface \\$iface     puts stdout \\\"\\$selected_iface\\\"     exit   } } pack .ok -padx 10 -pady 5  set selected_iface \\\"\\\"  vwait selected_iface  \"    echo \"$getiface\" | wish  }  # \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 iface=`select_iface`  # \u0432\u044b\u0432\u043e\u0434 \u043e\u043a\u043d\u0430 \u0441\u043f\u0438\u0441\u043a\u0430 \u0441\u0435\u0442\u0435\u0439 select_network() {  getnet=\" package require Tk wm title . \\\"Select network\\\" wm geometry . +300+50 wm protocol . WM_DELETE_WINDOW { exit }  label .l1 -text \\\"Select network\\\" pack .l1 -padx 10 -pady 5  listbox .list -width 50 -height 20 pack .list -padx 10 -pady 5  # \u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 set fd [open \\\"$temp_file\\\" r] set lines [split [read \\$fd] \\\"\\\\n\\\"] close \\$fd  foreach line \\$lines {   if {[regexp {(\\\\w+)} \\$line match essid]} {     .list insert end \\\"\\$essid\\\"   } }  button .ok -text \\\"Select\\\" -command {   set selection [.list get [.list curselection]]   set selected_net \\$selection   puts stdout \\\"\\$selected_net\\\"   exit }  pack .ok -padx 10 -pady 5  set selected_net \\\"\\\"  vwait selected_net  \"    echo \"$getnet\" | wish  }  # \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0435\u0442\u0435\u0439 scan_networks() {   sudo ip link set $1 up   echo -n \"\" &gt; \"$temp_file\"   echo \"Scan...\"   sudo iwlist $1 scan | grep -E 'ESSID|Signal level' | awk -F: '{print $2}' | sort | uniq &gt;&gt; \"$temp_file\" }  # \u0435\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432\u044b\u0431\u0440\u0430\u043d - \u0441\u043a\u0430\u043d\u0438\u0440\u0443\u0435\u043c \u0441\u0435\u0442\u0438 \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0438\u0437 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 if [ -n \"$iface\" ] ; then    scan_networks $iface    net=`select_network`    if [ -n \"$net\" ] ; then     key=`ask_pass \"WiFi password\"`     if [ -n \"$key\" ] ; then        # \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0434\u043b\u044f wpa_supplicant       conf=\" update_config=1  network={     ssid=\\\"$net\\\"     psk=\\\"$key\\\" } \"       sudo mkdir -p \/etc\/wpa_supplicant       file=\/etc\/wpa_supplicant\/wpa_supplicant_$iface.conf        # \u0448\u0430\u043c\u0430\u043d\u0441\u0442\u0432\u043e \u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u0444\u0430\u0439\u043b\u0430       sudo touch $file       sudo chmod 666 $file       sudo echo \"$conf\" &gt; $file       sudo chmod 644 $file        # \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c wpa_supplicant       pid=`ps ax| grep \"wpa_supplicant\" | grep -v grep | grep \"$iface\" | awk '{print $1}'`       if [ \"x$pid\" != \"x\" ]; then         sudo kill $pid       fi        pid=`ps ax| grep \"dhclient $iface\" | grep -v grep | awk '{print $1}'`       if [ \"x$pid\" != \"x\" ]; then         sudo kill $pid       fi        sudo wpa_supplicant -B -i \"$iface\" -c \/etc\/wpa_supplicant\/wpa_supplicant_$iface.conf         # \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c IP-\u0430\u0434\u0440\u0435\u0441 \u0447\u0435\u0440\u0435\u0437 DHCP       sudo dhclient \"$iface\"        msg=`ip addr show dev $iface | grep inet | awk '{print $1 \" \" $2 }'`       message \"$msg\"      else       message \"No WiFi password!\"     fi   else     message \"No network selected!\"   fi else   message \"No interface selected!\" fi  exit #===================================================== <\/code><\/pre>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u043f\u043e\u0434\u00a0\u043a\u0435\u043c \u043e\u043d \u0437\u0430\u043f\u0443\u0449\u0435\u043d, \u0435\u0441\u043b\u0438 \u043f\u043e\u0434\u00a0\u043e\u0431\u044b\u0447\u043d\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c\u00a0\u2014 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u043f\u0430\u0440\u043e\u043b\u044c \u0434\u043b\u044f\u00a0sudo, \u0437\u0430\u0442\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0441\u00a0WiFi (\u0438\u0445 \u043c\u043e\u0436\u0435\u0442\u00a0\u0431\u044b\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e), \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0431\u043e\u0440\u0430 \u0441\u043a\u0430\u043d\u0438\u0440\u0443\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0441\u0435\u0442\u0438, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u0442\u044c, \u043f\u043e\u0442\u043e\u043c \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u043d\u0444\u0438\u0433 \u0434\u043b\u044f\u00a0\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 wpa_supplicant. \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u043f\u0440\u043e\u0448\u043b\u043e \u0445\u043e\u0440\u043e\u0448\u043e\u00a0\u2014 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 IP\u2011\u0430\u0434\u0440\u0435\u0441\u0430 \u043d\u0430\u00a0\u044d\u0442\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435.<\/p>\n<p>\u0414\u043b\u044f\u00a0\u0442\u043e\u0433\u043e <\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-444143","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/444143","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=444143"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/444143\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=444143"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=444143"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=444143"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}