{"id":455227,"date":"2025-04-09T09:00:11","date_gmt":"2025-04-09T09:00:11","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=455227"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=455227","title":{"rendered":"<span>SSH \u043a wsl<\/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>\u0422\u0430\u043a \u0432\u044b\u0448\u043b\u043e\u00a0\u2014 \u0447\u0442\u043e\u00a0\u0432\u044b \u0433\u043e\u0440\u0434\u044b\u0439 \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044c wsl \u043d\u0430\u00a0\u0441\u0432\u043e\u0435\u043c \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435. \u041e\u0434\u043d\u0430\u043a\u043e \u043f\u043e\u00a0\u043a\u0430\u043a\u043e\u0439 \u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u043d\u0435\u00a0\u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a\u00a0\u0441\u0432\u043e\u0435\u0439 \u043b\u044e\u0431\u0438\u043c\u043e\u0439 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u043a\u0435 \u043f\u043e\u00a0ssh? \u0412\u043e\u0437\u0440\u0430\u0434\u0443\u0439\u0442\u0435\u0441\u044c! \u042d\u0442\u043e \u043f\u043e\u0441\u0442\u00a0\u2014 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f, \u0434\u043b\u044f\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a\u00a0\u0441\u0432\u043e\u0435\u0439 \u043a\u0440\u0430\u043d\u0447\u0438\u043b\u043a\u0435 \u0446\u0438\u0444\u0435\u0440\u043e\u043a. \u0414\u043b\u044f\u00a0\u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0449\u0438\u0442\u044b\u00a0\u2014 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c google\u2011authentificator \u0442\u0430\u043a \u043a\u0430\u043a\u00a0\u044d\u0442\u043e \u0434\u043e\u043c\u0430\u0448\u043d\u0438\u0439 \u0441\u0435\u0440\u0432\u0435\u0440, \u0438 \u043d\u0435\u00a0\u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0447\u0442\u043e\u0431\u044b \u043a\u00a0\u043d\u0435\u043c\u0443 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f \u0438\u0437\u2011\u0437\u0430 \u0433\u043b\u0443\u043f\u043e\u0439 \u0443\u0442\u0435\u0447\u043a\u0438.<\/p>\n<h2>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/h2>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0432 \u0448\u0430\u0433\u0438 \u0432 \u043c\u0435\u0442\u043e\u0434\u0438\u0447\u043a\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a wsl \u0447\u0435\u0440\u0435\u0437 vscode:<\/p>\n<ol>\n<li>\n<p>\u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u043e\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u043e ssh. (\u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0434\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0434\u043b\u044f vscode \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c)<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/451\/3f2\/f6a\/4513f2f6a3545317adb599fb09eeced0.png\" width=\"872\" height=\"582\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/451\/3f2\/f6a\/4513f2f6a3545317adb599fb09eeced0.png\"\/><\/figure>\n<\/li>\n<li>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043d\u0430\u0448 \u0445\u043e\u0441\u0442 \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b\u0439 \u0447\u0435\u0440\u0435\u0437 <code>~\/.ssh\/config<\/code><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b23\/246\/f17\/b23246f1710d0116b3b9159ab5433459.png\" alt=\" \" title=\" \" width=\"1534\" height=\"518\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b23\/246\/f17\/b23246f1710d0116b3b9159ab5433459.png\"\/><\/p>\n<div><figcaption> <\/figcaption><\/div>\n<\/figure>\n<\/li>\n<li>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u0432\u043e\u0434\u0438\u043c \u043d\u0430\u0448 verification code \u0438\u0437 \u0433\u0443\u0433\u043b \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5e2\/34d\/3e3\/5e234d3e386a27965f9d699b9b48b2b5.png\" width=\"2560\" height=\"2228\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5e2\/34d\/3e3\/5e234d3e386a27965f9d699b9b48b2b5.png\"\/><\/figure>\n<\/li>\n<li>\n<p>\u041d\u0443 \u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0445\u043e\u0434\u0438\u043c.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a93\/366\/bb1\/a93366bb19a7176a44bcc9a56ee67d26.png\" width=\"848\" height=\"170\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a93\/366\/bb1\/a93366bb19a7176a44bcc9a56ee67d26.png\"\/><\/figure>\n<\/li>\n<\/ol>\n<h2>\u0427\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u0438<\/h2>\n<ul>\n<li>\n<p>Windows11<\/p>\n<\/li>\n<li>\n<p>\u0420\u043e\u0443\u0442\u0435\u0440 \u0441 OpenWRT (\u043c\u0430\u0441\u0442\u0445\u0435\u0432 \u0432 \u043d\u0430\u0448\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0430)<\/p>\n<\/li>\n<li>\n<p>\u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u0439\u043f\u0438 \u043e\u0442 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 (\u043c\u043e\u0436\u0435\u0442 \u0438 \u043d\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u043e\u0434\u043d\u0430\u043a\u043e \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0442 NAT behind NAT \u043b\u043e\u043c\u0430\u043b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435)<\/p>\n<\/li>\n<\/ul>\n<h2>\u041c\u0435\u0442\u043e\u0434\u0438\u0447\u043a\u0430<\/h2>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u044f \u043e\u0444\u043e\u0440\u043c\u043b\u044f\u043b \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0434\u0430\u0432\u043d\u043e, \u0430 \u043f\u043e\u0441\u0442 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u0439\u0447\u0430\u0441, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0447\u0442\u043e \u043d\u0435 \u0432\u044b\u0439\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c stepbystep \u0433\u0430\u0439\u0434. \u041d\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0434\u0443\u043c\u0430\u044e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e. <\/p>\n<h4>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c ssh \u043d\u0430 windows:<\/h4>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0433\u0430\u0439\u0434, \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0445 &#8212; <a href=\"https:\/\/gist.github.com\/mattbell87\/f5bd7b78c8d0ad7f0dfc3addae4f4897#default-shell-method\" rel=\"noopener noreferrer nofollow\">https:\/\/gist.github.com\/mattbell87\/f5bd7b78c8d0ad7f0dfc3addae4f4897#default-shell-method<\/a>. \u041d\u043e \u0435\u0441\u043b\u0438 \u043d\u0435 \u0445\u043e\u0447\u0435\u0448\u044c \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f, \u043f\u0440\u043e\u0441\u0442\u043e \u043b\u0438\u0441\u0442\u0430\u0439 \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<p>\u041c\u0435\u0442\u043e\u0434\u043e\u043c \u043f\u0440\u043e\u0431 \u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u0434\u043b\u044f \u0441\u0435\u0431\u044f, \u0447\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0430\u043a\u043e\u0439:<\/p>\n<ol>\n<li>\n<p>\u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c powershell \u043e\u0442 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430<\/p>\n<\/li>\n<li>\n<p><code>Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0<br \/>Start-Service sshd<br \/>Set-Service -Name sshd -StartupType 'Automatic'<br \/>New-ItemProperty -Path \"HKLM:\\SOFTWARE\\OpenSSH\" -Name DefaultShell -Value \"C:\\WINDOWS\\System32\\bash.exe\" -PropertyType String -Force<br \/>Get-Service -Name sshd<\/code><\/p>\n<\/li>\n<li>\n<p>\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b \u0438 \u043a\u043b\u0430\u0434\u0435\u043c \u0432 \u043f\u0430\u043f\u043a\u0443 <code>C:\\Users\\&lt;\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c&gt;\\.ssh<\/code> \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c known_hosts. \u041c\u043e\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0442\u0430\u043a.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/32e\/f62\/71a\/32ef6271a72335a293a326c7b7fcbac2.png\" width=\"817\" height=\"261\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/32e\/f62\/71a\/32ef6271a72335a293a326c7b7fcbac2.png\"\/><\/figure>\n<\/li>\n<li>\n<p>\u0413\u043e\u0442\u043e\u0432\u043e. SSH \u043d\u0430 Windows11 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d. <\/p>\n<\/li>\n<\/ol>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 SSH \u043d\u0430 \u0440\u043e\u0443\u0442\u0435\u0440\u0435.<\/h4>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f, \u043e\u0442\u043a\u0443\u0434\u0430 \u0447\u0435\u0440\u043f\u0430\u043b \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u0435\u043d\u0438\u0435 <a href=\"https:\/\/forum.openwrt.org\/t\/howto-openssh-with-mfa-on-openwrt-19-07-x-using-google-authenticator\/88025\" rel=\"noopener noreferrer nofollow\">https:\/\/forum.openwrt.org\/t\/howto-openssh-with-mfa-on-openwrt-19-07-x-using-google-authenticator\/88025<\/a><\/p>\n<ol>\n<li>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043a \u0440\u043e\u0443\u0442\u0435\u0440\u0443. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0438 \u0447\u0435\u0440\u0435\u0437 dropbear.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0432 OpenWrt SSH-\u0441\u0435\u0440\u0432\u0435\u0440 Dropbear \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u043b <strong>\u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 (LAN)<\/strong> \u0438 <strong>\u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043f\u043e\u0440\u0442 22<\/strong> (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439 \u043f\u043e\u0440\u0442 20022). \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432 Luci \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443:<br \/> <a href=\"http:\/\/192.168.1.1\/cgi-bin\/luci\/admin\/system\/admin\/dropbear\" rel=\"noopener noreferrer nofollow\">http:\/\/192.168.1.1\/cgi-bin\/luci\/admin\/system\/admin\/dropbear<\/a>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0439\u0434\u0451\u0442 \u043d\u0435 \u0442\u0430\u043a \u0441 OpenSSH, \u0442\u044b \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0441\u043c\u043e\u0436\u0435\u0448\u044c \u0432\u043e\u0439\u0442\u0438 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043f\u043e \u0441\u0435\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 Dropbear.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0441\u044c \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e \u043d\u043e\u0432\u043e\u043c\u0443 dropbear \u043f\u043e\u0440\u0442\u0443 \u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b<\/p>\n<pre><code class=\"bash\">opkg update  opkg install google-authenticator-libpam openssh-server-pam ssh-keygen -t ed25519 # \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u044d\u0442\u043e\u0433\u043e \u0445\u0432\u0430\u0442\u0438\u0442, \u043d\u043e \u0435\u0441\u043b\u0438 \u043d\u0435\u0442 - \u0442\u043e \u0434\u043e\u0431\u0430\u0432\u044c \u043a\u043b\u044e\u0447\u0438 \u0432 authorized_keys service sshd restart google-authenticator<\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439 google-authentificator \u043f\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0441 \u044d\u0442\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0438 (\u0432 \u0446\u0435\u043b\u043e\u043c \u0442\u0430\u043c \u0432\u0441\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u043f\u043e \u043f\u0440\u043e\u043c\u043f\u0442\u0430\u043c) <a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-set-up-multi-factor-authentication-for-ssh-on-ubuntu-16-04#:~:text=Run\" rel=\"noopener noreferrer nofollow\">https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-set-up-multi-factor-authentication-for-ssh-on-ubuntu-16-04#:~:text=Run<\/a><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-set-up-multi-factor-authentication-for-ssh-on-ubuntu-16-04#:~:text=Run%20the%20initialization%20app\" rel=\"noopener noreferrer nofollow\"> the initialization app<\/a><\/p>\n<\/li>\n<li>\n<p> \u041e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0439 \u0444\u0430\u0439\u043b \/etc\/ssh\/sshd_config (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>nano \/etc\/ssh\/sshd_config<\/code>), \u0447\u0442\u043e\u0431\u044b \u0432\u043d\u0435\u0441\u0442\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f: <\/p>\n<p><code>PermitRootLogin yes|<\/code><br \/><code>PubkeyAuthentication yes<\/code><br \/><code>ChallengeResponseAuthentication yes<\/code><br \/><code>UsePAM yes<\/code><br \/><code>AuthenticationMethods publickey,keyboard-interactive<\/code><\/p>\n<\/li>\n<li>\n<p> \u041e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0439 \u0444\u0430\u0439\u043b <code>\/etc\/pam.d\/sshd<\/code> (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>nano \/etc\/pam.d\/sshd<\/code>), \u0447\u0442\u043e\u0431\u044b \u0432\u043d\u0435\u0441\u0442\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f:  <br \/>\u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0439 \u0441\u0442\u0440\u043e\u043a\u0443 <code>#auth include common-auth<\/code><br \/>\u0414\u043e\u0431\u0430\u0432\u044c \u0432 \u043a\u043e\u043d\u0435\u0446 \u0444\u0430\u0439\u043b\u0430 auth <code>required \/usr\/lib\/security\/pam_google_<\/code><a href=\"http:\/\/authenticator.so\" rel=\"noopener noreferrer nofollow\"><code>authenticator.so<\/code><\/a>  <\/p>\n<\/li>\n<li>\n<p><code>service sshd restart<\/code>  <\/p>\n<\/li>\n<li>\n<p> \u041d\u0430\u0441\u0442\u0440\u043e\u0439 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u0432 \u0431\u0440\u0430\u043d\u0434\u043c\u0430\u0443\u044d\u0440\u0435 (\u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443: <a href=\"http:\/\/192.168.1.1\/cgi-bin\/luci\/admin\/network\/firewall\/rules\" rel=\"noopener noreferrer nofollow\">http:\/\/192.168.1.1\/cgi-bin\/luci\/admin\/network\/firewall\/rules<\/a>), \u0435\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0448\u044c \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a OpenSSH \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430.<\/p>\n<\/li>\n<\/ol>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 ssh \u043d\u0430 \u0442\u0430\u0447\u043a\u0435 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f<\/h4>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c \u0432 ~\/.ssh\/config \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438, \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0432 \u0438\u0445 \u0441\u0432\u043e\u0438\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438<\/p>\n<pre><code>Host router     Port &lt;\u043f\u043e\u0440\u0442 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0440\u043e\u0443\u0442\u0435\u0440\u0443 \u043f\u043e SSH \u043d\u0435 DROPBEAR!&gt;     HostName &lt;ip \u0440\u043e\u0443\u0442\u0435\u0440\u0430 (\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0434\u0430\u043b \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440)     User root     IdentityFile ~\/.ssh\/router_2     ForwardAgent yes  Host windows     ProxyCommand ssh -W %h:%p router     HostName &lt;\u0445\u043e\u0441\u0442\u043d\u0435\u0439\u043c windows \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u0440\u043e\u0443\u0442\u0435\u0440\u0430&gt;     User artem     IdentityFile ~\/.ssh\/windows     ServerAliveInterval 60     ServerAliveCountMax 3<\/code><\/pre>\n<h2>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438<\/h2>\n<p>\u0415\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f &#8212; \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u043f\u0443\u0441\u043a \u0438 \u0433\u0430\u0448\u0435\u043d\u0438\u0435 \u0442\u0430\u0447\u043a\u0438 \u0447\u0435\u0440\u0435\u0437 wakeonlan.<\/p>\n<ol>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c wakeonlan \u043d\u0430 \u0440\u043e\u0443\u0442\u0435\u0440\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043c\u0430\u0448\u0438\u043d\u044b \u0438\u0437 \u0440\u0435\u0436\u0438\u043c\u0430 \u0441\u043d\u0430: \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043a \u0440\u043e\u0443\u0442\u0435\u0440\u0443, \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<br \/><code>wakeonlan -i &lt;\u0445\u043e\u0441\u0442 \u043c\u0430\u0448\u0438\u043d\u044b windows \u0432\u043d\u0443\u0442\u0440\u0438 OpenWRT&gt; 04:7C:16:C7:30:E8<\/code><\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u043f\u043e\u0433\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043c\u0430\u0448\u0438\u043d\u044b \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u0441\u043e\u043d (\u0434\u043b\u044f \u043b\u044e\u0434\u0435\u0439 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u044e\u0442 \u0433\u0430\u0437 \u0438 \u0441\u0432\u0435\u0442 \u043f\u0440\u0438 \u0443\u0445\u043e\u0434\u0435 \u0438\u0437 \u0434\u043e\u043c\u0430), \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 vscode \u043a\u043e\u0433\u0434\u0430 \u0443\u0436\u0435 \u043f\u043e\u043a\u043b\u044e\u0447\u0438\u043b\u0438\u0441\u044c \u043a \u0432\u0438\u043d\u0434\u0435 &#8212; \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<br \/><code>shutdown.exe \/s<\/code><\/p>\n<\/li>\n<\/ol>\n<h2>\u0412\u044b\u0432\u043e\u0434\u044b<\/h2>\n<p>\u0421\u0438\u043b\u044c\u043d\u043e \u0437\u0430\u043c\u043e\u0440\u043e\u0447\u0438\u0432\u0448\u0438\u0441\u044c \u0438 \u043f\u043e\u043d\u044f\u0432 \u0434\u0437\u0435\u043d \u0441\u0435\u0442\u0435\u0439 &#8212; \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0432\u043e\u0435\u0439 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u043a\u0435. \u042f \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u044e \u043e\u0442\u0434\u043e\u0445\u043d\u0443\u0442\u044c \u0441\u0432\u043e\u0435\u0439 \u0431\u043e\u043b\u044c\u043d\u043e\u0439 \u0441\u043f\u0438\u043d\u0435 \u043e\u0442 \u043f\u043e\u0437\u044b \u043a\u0435\u0448\u044c\u044e-\u043a\u0440\u0435\u0432\u0435\u0442\u043a\u0438 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u0437\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u043c \u043b\u0435\u0436\u0430 \u043d\u0430 \u0434\u0438\u0432\u0430\u043d\u0447\u0438\u043a\u0435 \ud83d\ude42<\/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\/899000\/\"> https:\/\/habr.com\/ru\/articles\/899000\/<\/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>\u0422\u0430\u043a \u0432\u044b\u0448\u043b\u043e\u00a0\u2014 \u0447\u0442\u043e\u00a0\u0432\u044b \u0433\u043e\u0440\u0434\u044b\u0439 \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u0435\u043b\u044c wsl \u043d\u0430\u00a0\u0441\u0432\u043e\u0435\u043c \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435. \u041e\u0434\u043d\u0430\u043a\u043e \u043f\u043e\u00a0\u043a\u0430\u043a\u043e\u0439 \u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u043d\u0435\u00a0\u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a\u00a0\u0441\u0432\u043e\u0435\u0439 \u043b\u044e\u0431\u0438\u043c\u043e\u0439 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u043a\u0435 \u043f\u043e\u00a0ssh? \u0412\u043e\u0437\u0440\u0430\u0434\u0443\u0439\u0442\u0435\u0441\u044c! \u042d\u0442\u043e \u043f\u043e\u0441\u0442\u00a0\u2014 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f, \u0434\u043b\u044f\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a\u00a0\u0441\u0432\u043e\u0435\u0439 \u043a\u0440\u0430\u043d\u0447\u0438\u043b\u043a\u0435 \u0446\u0438\u0444\u0435\u0440\u043e\u043a. \u0414\u043b\u044f\u00a0\u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0449\u0438\u0442\u044b\u00a0\u2014 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c google\u2011authentificator \u0442\u0430\u043a \u043a\u0430\u043a\u00a0\u044d\u0442\u043e \u0434\u043e\u043c\u0430\u0448\u043d\u0438\u0439 \u0441\u0435\u0440\u0432\u0435\u0440, \u0438 \u043d\u0435\u00a0\u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0447\u0442\u043e\u0431\u044b \u043a\u00a0\u043d\u0435\u043c\u0443 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f \u0438\u0437\u2011\u0437\u0430 \u0433\u043b\u0443\u043f\u043e\u0439 \u0443\u0442\u0435\u0447\u043a\u0438.<\/p>\n<h2>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/h2>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0432 \u0448\u0430\u0433\u0438 \u0432 \u043c\u0435\u0442\u043e\u0434\u0438\u0447\u043a\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a wsl \u0447\u0435\u0440\u0435\u0437 vscode:<\/p>\n<ol>\n<li>\n<p>\u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u043e\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u043e ssh. (\u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0434\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0434\u043b\u044f vscode \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c)<\/p>\n<figure class=\"full-width\"><\/figure>\n<\/li>\n<li>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043d\u0430\u0448 \u0445\u043e\u0441\u0442 \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b\u0439 \u0447\u0435\u0440\u0435\u0437 <code>~\/.ssh\/config<\/code><\/p>\n<figure class=\"full-width\">\n<div><figcaption> <\/figcaption><\/div>\n<\/figure>\n<\/li>\n<li>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u0432\u043e\u0434\u0438\u043c \u043d\u0430\u0448 verification code \u0438\u0437 \u0433\u0443\u0433\u043b \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430.<\/p>\n<figure class=\"full-width\"><\/figure>\n<\/li>\n<li>\n<p>\u041d\u0443 \u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0445\u043e\u0434\u0438\u043c.<\/p>\n<figure class=\"full-width\"><\/figure>\n<\/li>\n<\/ol>\n<h2>\u0427\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u0438<\/h2>\n<ul>\n<li>\n<p>Windows11<\/p>\n<\/li>\n<li>\n<p>\u0420\u043e\u0443\u0442\u0435\u0440 \u0441 OpenWRT (\u043c\u0430\u0441\u0442\u0445\u0435\u0432 \u0432 \u043d\u0430\u0448\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0430)<\/p>\n<\/li>\n<li>\n<p>\u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u0439\u043f\u0438 \u043e\u0442 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 (\u043c\u043e\u0436\u0435\u0442 \u0438 \u043d\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u043e\u0434\u043d\u0430\u043a\u043e \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0442 NAT behind NAT \u043b\u043e\u043c\u0430\u043b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435)<\/p>\n<\/li>\n<\/ul>\n<h2>\u041c\u0435\u0442\u043e\u0434\u0438\u0447\u043a\u0430<\/h2>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u044f \u043e\u0444\u043e\u0440\u043c\u043b\u044f\u043b \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0434\u0430\u0432\u043d\u043e, \u0430 \u043f\u043e\u0441\u0442 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u0439\u0447\u0430\u0441, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0447\u0442\u043e \u043d\u0435 \u0432\u044b\u0439\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c stepbystep \u0433\u0430\u0439\u0434. \u041d\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0434\u0443\u043c\u0430\u044e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e. <\/p>\n<h4>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c ssh \u043d\u0430 windows:<\/h4>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0433\u0430\u0439\u0434, \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0445 &#8212; <a href=\"https:\/\/gist.github.com\/mattbell87\/f5bd7b78c8d0ad7f0dfc3addae4f4897#default-shell-method\" rel=\"noopener noreferrer nofollow\">https:\/\/gist.github.com\/mattbell87\/f5bd7b78c8d0ad7f0dfc3addae4f4897#default-shell-method<\/a>. \u041d\u043e \u0435\u0441\u043b\u0438 \u043d\u0435 \u0445\u043e\u0447\u0435\u0448\u044c \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f, \u043f\u0440\u043e\u0441\u0442\u043e \u043b\u0438\u0441\u0442\u0430\u0439 \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<p>\u041c\u0435\u0442\u043e\u0434\u043e\u043c \u043f\u0440\u043e\u0431 \u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u0434\u043b\u044f \u0441\u0435\u0431\u044f, \u0447\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0430\u043a\u043e\u0439:<\/p>\n<ol>\n<li>\n<p>\u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c powershell \u043e\u0442 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430<\/p>\n<\/li>\n<li>\n<p><code>Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0<br \/>Start-Service sshd<br \/>Set-Service -Name sshd -StartupType 'Automatic'<br \/>New-ItemProperty -Path \"HKLM:\\SOFTWARE\\OpenSSH\" -Name DefaultShell -Value \"C:\\WINDOWS\\System32\\bash.exe\" -PropertyType String -Force<br \/>Get-Service -Name sshd<\/code><\/p>\n<\/li>\n<li>\n<p>\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b \u0438 \u043a\u043b\u0430\u0434\u0435\u043c \u0432 \u043f\u0430\u043f\u043a\u0443 <code>C:\\Users\\&lt;\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c&gt;\\.ssh<\/code> \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c known_hosts. \u041c\u043e\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0442\u0430\u043a.<\/p>\n<figure class=\"full-width\"><\/figure>\n<\/li>\n<li>\n<p>\u0413\u043e\u0442\u043e\u0432\u043e. SSH \u043d\u0430 Windows11 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d. <\/p>\n<\/li>\n<\/ol>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 SSH \u043d\u0430 \u0440\u043e\u0443\u0442\u0435\u0440\u0435.<\/h4>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f, \u043e\u0442\u043a\u0443\u0434\u0430 \u0447\u0435\u0440\u043f\u0430\u043b \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u0435\u043d\u0438\u0435 <a href=\"https:\/\/forum.openwrt.org\/t\/howto-openssh-with-mfa-on-openwrt-19-07-x-using-google-authenticator\/88025\" rel=\"noopener noreferrer nofollow\">https:\/\/forum.openwrt.org\/t\/howto-openssh-with-mfa-on-openwrt-19-07-x-using-google-authenticator\/88025<\/a><\/p>\n<ol>\n<li>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043a \u0440\u043e\u0443\u0442\u0435\u0440\u0443. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0438 \u0447\u0435\u0440\u0435\u0437 dropbear.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0432 OpenWrt SSH-\u0441\u0435\u0440\u0432\u0435\u0440 Dropbear \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u043b <strong>\u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 (LAN)<\/strong> \u0438 <strong>\u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043f\u043e\u0440\u0442 22<\/strong> (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439 \u043f\u043e\u0440\u0442 20022). \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432 Luci \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443:<br \/> <a href=\"http:\/\/192.168.1.1\/cgi-bin\/luci\/admin\/system\/admin\/dropbear\" rel=\"noopener noreferrer nofollow\">http:\/\/192.168.1.1\/cgi-bin\/luci\/admin\/system\/admin\/dropbear<\/a>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0439\u0434\u0451\u0442 \u043d\u0435 \u0442\u0430\u043a \u0441 OpenSSH, \u0442\u044b \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0441\u043c\u043e\u0436\u0435\u0448\u044c \u0432\u043e\u0439\u0442\u0438 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043f\u043e \u0441\u0435\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 Dropbear.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0441\u044c \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e \u043d\u043e\u0432\u043e\u043c\u0443 dropbear \u043f\u043e\u0440\u0442\u0443 \u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b<\/p>\n<pre><code class=\"bash\">opkg update  opkg install google-authenticator-libpam openssh-server-pam ssh-keygen -t ed25519 # \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u044d\u0442\u043e\u0433\u043e \u0445\u0432\u0430\u0442\u0438\u0442, \u043d\u043e \u0435\u0441\u043b\u0438 \u043d\u0435\u0442 - \u0442\u043e \u0434\u043e\u0431\u0430\u0432\u044c \u043a\u043b\u044e\u0447\u0438 \u0432 authorized_keys service sshd restart google-authenticator<\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439 google-authentificator \u043f\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0441 \u044d\u0442\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0438 (\u0432 \u0446\u0435\u043b\u043e\u043c \u0442\u0430\u043c \u0432\u0441\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u043f\u043e \u043f\u0440\u043e\u043c\u043f\u0442\u0430\u043c) <a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-set-up-multi-factor-authentication-for-ssh-on-ubuntu-16-04#:~:text=Run\" rel=\"noopener noreferrer nofollow\">https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-set-up-multi-factor-authentication-for-ssh-on-ubuntu-16-04#:~:text=Run<\/a><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-set-up-multi-factor-authentication-for-ssh-on-ubuntu-16-04#:~:text=Run%20the%20initialization%20app\" rel=\"noopener noreferrer nofollow\"> the initialization app<\/a><\/p>\n<\/li>\n<li>\n<p> \u041e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0439 \u0444\u0430\u0439\u043b \/etc\/ssh\/sshd_config (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>nano \/etc\/ssh\/sshd_config<\/code>), \u0447\u0442\u043e\u0431\u044b \u0432\u043d\u0435\u0441\u0442\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f: <\/p>\n<p><code>PermitRootLogin yes|<\/code><br \/><code>PubkeyAuthentication yes<\/code><br \/><code>ChallengeResponseAuthentication yes<\/code><br \/><code>UsePAM yes<\/code><br \/><code>AuthenticationMethods publickey,keyboard-interactive<\/code><\/p>\n<\/li>\n<li>\n<p> \u041e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0439 \u0444\u0430\u0439\u043b <code>\/etc\/pam.d\/sshd<\/code> (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>nano \/etc\/pam.d\/sshd<\/code>), \u0447\u0442\u043e\u0431\u044b \u0432\u043d\u0435\u0441\u0442\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f:  <br \/>\u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0439 \u0441\u0442\u0440\u043e\u043a\u0443 <code>#auth include common-auth<\/code><br \/>\u0414\u043e\u0431\u0430\u0432\u044c \u0432 \u043a\u043e\u043d\u0435\u0446 \u0444\u0430\u0439\u043b\u0430 auth <code>required \/usr\/lib\/security\/pam_google_<\/code><a href=\"http:\/\/authenticator.so\" rel=\"noopener noreferrer nofollow\"><code>authenticator.so<\/code><\/a>  <\/p>\n<\/li>\n<li>\n<p><code>service sshd restart<\/code>  <\/p>\n<\/li>\n<li>\n<p> \u041d\u0430\u0441\u0442\u0440\u043e\u0439 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u0432 \u0431\u0440\u0430\u043d\u0434\u043c\u0430\u0443\u044d\u0440\u0435 (\u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443: <a href=\"http:\/\/192.168.1.1\/cgi-bin\/luci\/admin\/network\/firewall\/rules\" rel=\"noopener noreferrer nofollow\">http:\/\/192.168.1.1\/cgi-bin\/luci\/admin\/network\/firewall\/rules<\/a>), \u0435\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0448\u044c \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a OpenSSH \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430.<\/p>\n<\/li>\n<\/ol>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 ssh \u043d\u0430 \u0442\u0430\u0447\u043a\u0435 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f<\/h4>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c \u0432 ~\/.ssh\/config \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438, \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0432 \u0438\u0445 \u0441\u0432\u043e\u0438\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438<\/p>\n<pre><code>Host router     Port &lt;\u043f\u043e\u0440\u0442 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0440\u043e\u0443\u0442\u0435\u0440\u0443 \u043f\u043e SSH \u043d\u0435 DROPBEAR!&gt;     HostName &lt;ip \u0440\u043e\u0443\u0442\u0435\u0440\u0430 (\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0434\u0430\u043b \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440)     User root     IdentityFile ~\/.ssh\/router_2     ForwardAgent yes  Host windows     ProxyCommand ssh -W %h:%p router     HostName &lt;\u0445\u043e\u0441\u0442\u043d\u0435\u0439\u043c windows \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u0440\u043e\u0443\u0442\u0435\u0440\u0430&gt;     User artem     IdentityFile ~\/.ssh\/windows     ServerAliveInterval 60     ServerAliveCountMax 3<\/code><\/pre>\n<h2>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438<\/h2>\n<p>\u0415\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f &#8212; \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u043f\u0443\u0441\u043a \u0438 \u0433\u0430\u0448\u0435\u043d\u0438\u0435 \u0442\u0430\u0447\u043a\u0438 \u0447\u0435\u0440\u0435\u0437 wakeonlan.<\/p>\n<ol>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c wakeonlan \u043d\u0430 \u0440\u043e\u0443\u0442\u0435\u0440\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043c\u0430\u0448\u0438\u043d\u044b \u0438\u0437 \u0440\u0435\u0436\u0438\u043c\u0430 \u0441\u043d\u0430: \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043a \u0440\u043e\u0443\u0442\u0435\u0440\u0443, \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<br \/><code>wakeonlan -i &lt;\u0445\u043e\u0441\u0442 \u043c\u0430\u0448\u0438\u043d\u044b windows \u0432\u043d\u0443\u0442\u0440\u0438 OpenWRT&gt; 04:7C:16:C7:30:E8<\/code><\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u043f\u043e\u0433\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043c\u0430\u0448\u0438\u043d\u044b \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u0441\u043e\u043d (\u0434\u043b\u044f \u043b\u044e\u0434\u0435\u0439 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u044e\u0442 \u0433\u0430\u0437 \u0438 \u0441\u0432\u0435\u0442 \u043f\u0440\u0438 \u0443\u0445\u043e\u0434\u0435 \u0438\u0437 \u0434\u043e\u043c\u0430), \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 vscode \u043a\u043e\u0433\u0434\u0430 \u0443\u0436\u0435 \u043f\u043e\u043a\u043b\u044e\u0447\u0438\u043b\u0438\u0441\u044c \u043a \u0432\u0438\u043d\u0434\u0435 &#8212; \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<br \/><code>shutdown.exe \/s<\/code><\/p>\n<\/li>\n<\/ol>\n<h2>\u0412\u044b\u0432\u043e\u0434\u044b<\/h2>\n<p>\u0421\u0438\u043b\u044c\u043d\u043e \u0437\u0430\u043c\u043e\u0440\u043e\u0447\u0438\u0432\u0448\u0438\u0441\u044c \u0438 \u043f\u043e\u043d\u044f\u0432 \u0434\u0437\u0435\u043d \u0441\u0435\u0442\u0435\u0439 &#8212; \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0432\u043e\u0435\u0439 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u043a\u0435. \u042f \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u044e \u043e\u0442\u0434\u043e\u0445\u043d\u0443\u0442\u044c \u0441\u0432\u043e\u0435\u0439 \u0431\u043e\u043b\u044c\u043d\u043e\u0439 \u0441\u043f\u0438\u043d\u0435 \u043e\u0442 \u043f\u043e\u0437\u044b \u043a\u0435\u0448\u044c\u044e-\u043a\u0440\u0435\u0432\u0435\u0442\u043a\u0438 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u0437\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u043c \u043b\u0435\u0436\u0430 \u043d\u0430 \u0434\u0438\u0432\u0430\u043d\u0447\u0438\u043a\u0435 \ud83d\ude42<\/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\/899000\/\"> https:\/\/habr.com\/ru\/articles\/899000\/<\/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-455227","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/455227","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=455227"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/455227\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=455227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=455227"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=455227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}