{"id":9281,"date":"2021-01-29T23:22:32","date_gmt":"2021-01-29T15:22:32","guid":{"rendered":"https:\/\/bohu.net\/blog\/?p=9278"},"modified":"2021-01-31T21:48:45","modified_gmt":"2021-01-31T13:48:45","slug":"%e8%a7%a3%e5%86%b3wsl%e4%b8%a4%e4%b8%aa%e5%ad%90%e7%b3%bb%e7%bb%9f%e5%90%8c%e6%97%b6%e7%99%bb%e5%bd%95ssh%ef%bc%8c%e4%bb%a5%e5%8f%8aping%ef%bc%8csftp%e6%9d%83%e9%99%90%e7%9a%84%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"https:\/\/www.bohu.net\/blog\/9281\/","title":{"rendered":"\u89e3\u51b3wsl\u4e24\u4e2a\u5b50\u7cfb\u7edf\u540c\u65f6\u767b\u5f55ssh\uff0c\u4ee5\u53caping\uff0csftp\u6743\u9650\u7684\u95ee\u9898"},"content":{"rendered":"\n<p>\u91cd\u88c5\u4e86windows\u7684linux\u5b50\u7cfb\u7edf\uff0c\u4ecewsl\u5230wsl2\uff0c\u5b89\u88c5\u4e86\u4e00\u4e2akali\uff0c\u4e00\u4e2adebian\uff08\u5176\u5b9e\u8fd9\u4e24\u4e2a\u88c5\u4e00\u4e2a\u5c31\u884c\u4e86\uff09<\/p>\n\n\n\n<p>\u8bd5\u8bd5\u80fd\u4e0d\u80fdssh\uff0c\u53d1\u73b0\u6ca1ssh\u670d\u52a1\uff0c\u5148\u5b89\u88c5<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install openssh-server\nsudo systemctl start ssh<\/code><\/pre>\n\n\n\n<p>\u4e4b\u540essh\u4e0a\u53bb\u4e4b\u540e\uff0c\u60f3\u6539ssh\u7aef\u53e3\uff0c\u53d1\u73b0sftp\u7f16\u8f91sshd_config\u6587\u4ef6\u63d0\u793a\u201cPermission denied\u201d\u3002\u7ed9sshd_config\u52a0\u4e0a\u6743\u9650\uff0c\u8fd8\u4e0d\u884c\uff0c\u53d1\u73b0\u539f\u6765\u662fsftp-server\u6ca1\u6743\u9650\u3002\u3002\u3002\u52a0\u4e0a\u6743\u9650\uff0c\u53ef\u4ee5\u7f16\u8f91\u6587\u4ef6\u4e86\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo chmod u+s \/usr\/lib\/openssh\/sftp-server<\/code><\/pre>\n\n\n\n<p>\u8bbe\u7f6essh\u81ea\u542f\u52a8<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl enable ssh<\/code><\/pre>\n\n\n\n<p>\u67e5\u770b\u5b50\u7cfb\u7edfIP\u5730\u5740\uff0cping\u81ea\u5df1\u4e00\u4e0b\u4e5f\u662f\u6ca1\u6743\u9650\u3002\u52a0\u4e0a\u6743\u9650<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo chmod u+s \/usr\/bin\/ping<\/code><\/pre>\n\n\n\n<p>\u7136\u540e\u540c\u65f6\u5f00\u4e86kali\uff0cdebian\u4e24\u4e2a\u5b50\u7cfb\u7edf\u7684CMD\u7a97\u53e3\u3002\u67e5\u770bip\uff0c\u7adf\u7136\u4e24\u4e2a\u5b50\u7cfb\u7edfip\u5730\u5740\u662f\u4e00\u6837\u7684\uff1f\u6ca1\u641e\u660e\u767d\uff0c\u600e\u4e48\u9009\u62e9\u767b\u5f55\u53e6\u4e00\u4e2a\u5b50\u7cfb\u7edf\uff1f\u662f\u4e0d\u662f\u4e0d\u80fd\u540c\u65f6\u767b\u5f55\u4e24\u4e2a\u5b50\u7cfb\u7edf\u5462\uff1f<\/p>\n\n\n\n<p>\u5148\u6d4b\u8bd5\u4e00\u4e0b\uff0c\u6253\u5f00\u4e24\u4e2a\u5b50\u7cfb\u7edf\uff08\u987a\u5e8f\u662f\u5148kali\uff0c\u518dDebian\uff09\uff0cssh\u767b\u5f5522\u7aef\u53e3\uff0c\u8fde\u5230\u7684\u662f\u7b2c\u4e00\u4e2a\u6253\u5f00\u7684\u5b50\u7cfb\u7edfkali\u3002\u518d\u4fee\u6539\u5b50\u7cfb\u7edfkali\u7684ssh\u7aef\u53e3\u52302022\uff0c\u518d\u8fde22\u7aef\u53e3\uff0c\u8fde\u63a5\u5931\u8d25\uff0csudo service ssh restart \u91cd\u542f\u5b50\u7cfb\u7edfDebian\u7684ssh\u670d\u52a1\uff0c\u518d\u8fde22\u7aef\u53e3\uff0cDebian\u5c31\u8fde\u4e0a\u4e86\u3002\u8fd9\u6837\u4e24\u53f0\u5b50\u7cfb\u7edf\u5c31\u53ef\u4ee5\u540c\u65f6ssh\u767b\u5f55\u3002<\/p>\n\n\n\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n\n\n\n<p><span class=\"has-inline-color has-bright-red-color\">#<\/span>\u5982\u679cDebian \u4e2d<code>service<\/code> \u547d\u4ee4\u4e0d\u5b58\u5728\uff0c\u5148\u5b89\u88c5 sysvinit-utils \u5305.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get install sysvinit-utils<\/code><\/pre>\n\n\n\n<p>\u5982\u679c\u5df2\u7ecf\u5b89\u88c5\uff0c\u5148\u5728~\/.bashrc \u4e2d\u6dfb\u52a0 $PATH<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>PATH=$PATH:\/usr\/sbin<\/code><\/pre>\n\n\n\n<p>\u91cd\u542fbash\uff0cservice\u547d\u4ee4\u5c31\u53ef\u7528\u4e86\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> service --status-all<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u91cd\u88c5\u4e86windows\u7684linux\u5b50\u7cfb\u7edf\uff0c\u4ecewsl\u5230wsl2\uff0c\u5b89\u88c5\u4e86\u4e00\u4e2akali\uff0c\u4e00\u4e2adebian\uff08\u5176\u5b9e\u8fd9\u4e24\u4e2a\u88c5 &hellip; <a href=\"https:\/\/www.bohu.net\/blog\/9281\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201c\u89e3\u51b3wsl\u4e24\u4e2a\u5b50\u7cfb\u7edf\u540c\u65f6\u767b\u5f55ssh\uff0c\u4ee5\u53caping\uff0csftp\u6743\u9650\u7684\u95ee\u9898\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,27,28,29],"tags":[674,675,673,671,672,676],"class_list":["post-9281","post","type-post","status-publish","format-standard","hentry","category-linux","category-27","category-28","category-29","tag-ping","tag-sftp","tag-ssh","tag-wsl","tag-672","tag-676"],"_links":{"self":[{"href":"https:\/\/www.bohu.net\/blog\/wp-json\/wp\/v2\/posts\/9281","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bohu.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bohu.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bohu.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bohu.net\/blog\/wp-json\/wp\/v2\/comments?post=9281"}],"version-history":[{"count":0,"href":"https:\/\/www.bohu.net\/blog\/wp-json\/wp\/v2\/posts\/9281\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.bohu.net\/blog\/wp-json\/wp\/v2\/media?parent=9281"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bohu.net\/blog\/wp-json\/wp\/v2\/categories?post=9281"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bohu.net\/blog\/wp-json\/wp\/v2\/tags?post=9281"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}