{"id":26,"date":"2024-10-03T15:01:04","date_gmt":"2024-10-03T07:01:04","guid":{"rendered":"https:\/\/www.bandifee.com\/?p=26"},"modified":"2024-10-03T15:02:32","modified_gmt":"2024-10-03T07:02:32","slug":"%e5%88%a4%e6%96%ad%e6%9c%8d%e5%8a%a1%e5%99%a8%e6%98%af%e5%90%a6%e5%9c%a8%e7%ba%bf","status":"publish","type":"post","link":"https:\/\/blog.bandifee.com\/index.php\/2024\/10\/03\/%e5%88%a4%e6%96%ad%e6%9c%8d%e5%8a%a1%e5%99%a8%e6%98%af%e5%90%a6%e5%9c%a8%e7%ba%bf\/","title":{"rendered":"\u5224\u65ad\u670d\u52a1\u5668\u662f\u5426\u5728\u7ebf"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u539f\u7406:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u5728\u670d\u52a1\u5668\u4e0a\u4e00\u76f4\u8fd0\u884c\u7684\u670d\u52a1\u6765\u5224\u65ad\u670d\u52a1\u5668\u662f\u5426\u6b63\u5e38\u5728\u7ebf(\u6bd4\u5982SSH)\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9e\u73b0(PHP80 SSH2):<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/\u9700\u8981\u5b89\u88c5PHP SSH2\u6269\u5c55!\nfunction is_online($host = \"localhost\", $port = 22, $username = \"root\", $password = \"\", $timeout = 2) : bool\n{\n    try\n    {\n        $ssh = @ssh2_connect($host, $port, &#91;'timeout' => $timeout]);\n        if($ssh === false) return false;\n        return @ssh2_auth_password($ssh, $username, $password);\n    }\n    catch (Exception $e)\n    {\n        return false;\n    }\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u539f\u7406: \u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u5728\u670d\u52a1\u5668\u4e0a\u4e00\u76f4\u8fd0\u884c\u7684\u670d\u52a1\u6765\u5224\u65ad\u670d\u52a1\u5668\u662f\u5426\u6b63\u5e38\u5728\u7ebf(\u6bd4\u5982SSH)\u3002 \u5b9e\u73b0(PHP80 SSH2):<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[6],"tags":[2,5],"class_list":["post-26","post","type-post","status-publish","format-standard","hentry","category-6","tag-php","tag-ssh"],"_links":{"self":[{"href":"https:\/\/blog.bandifee.com\/index.php\/wp-json\/wp\/v2\/posts\/26","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.bandifee.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.bandifee.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.bandifee.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.bandifee.com\/index.php\/wp-json\/wp\/v2\/comments?post=26"}],"version-history":[{"count":3,"href":"https:\/\/blog.bandifee.com\/index.php\/wp-json\/wp\/v2\/posts\/26\/revisions"}],"predecessor-version":[{"id":29,"href":"https:\/\/blog.bandifee.com\/index.php\/wp-json\/wp\/v2\/posts\/26\/revisions\/29"}],"wp:attachment":[{"href":"https:\/\/blog.bandifee.com\/index.php\/wp-json\/wp\/v2\/media?parent=26"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bandifee.com\/index.php\/wp-json\/wp\/v2\/categories?post=26"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bandifee.com\/index.php\/wp-json\/wp\/v2\/tags?post=26"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}