{"id":549,"date":"2025-12-16T11:26:01","date_gmt":"2025-12-16T03:26:01","guid":{"rendered":"https:\/\/blog.jason-lam.com\/?p=549"},"modified":"2025-12-31T00:10:31","modified_gmt":"2025-12-30T16:10:31","slug":"vps-%e5%b8%b8%e7%94%a8%e6%8c%87%e4%bb%a4-ubuntu","status":"publish","type":"post","link":"https:\/\/blog.jason-lam.com\/?p=549","title":{"rendered":"VPS \u5e38\u7528\u6307\u4ee4 &#8211; Ubuntu"},"content":{"rendered":"\n<p>man: manual\u7684\u7e2e\u5beb\uff0c\u60f3\u77e5\u9053\u4e00\u500b\u6307\u4ee4\u662f\u5982\u4f55\u4f7f\u7528\uff0c\u76f4\u63a5\u7528\u5b83\u4f86\u67e5\u5c31\u53ef\u4ee5\u3002<br>\u4f8b\u5982: man cp (\u986f\u793alinux\u6307\u4ee4 cp \u7684\u8a73\u4f7f\u7528\u65b9\u6cd5)\u3002\u7576\u7136\uff0c\u4f60\u4e5f\u53ef\u4ee5\u76f4\u63a5\u8f38\u5165 man man\u4f86\u4e86\u89e3man\u7684\u8a73\u7d30\u4f7f\u7528\u65b9\u6cd5\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>chmod (Change Mode)<br>r=4, w=2, x=1 <br><\/p>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><\/td><td><\/td><td>\u5c0d\u6587\u4ef6\/\u6a94\u6848\u7684\u5c6c\u6027<\/td><td>\u5c0d\u76ee\u9304\u7684\u5c6c\u6027<\/td><\/tr><tr><td>r<\/td><td>\u8b80\u6b0a\u9650<\/td><td>\u53ef\u4ee5\u67e5\u770b\u6587\u4ef6\u5167\u5bb9<\/td><td>\u53ef\u4ee5\u5217\u51fa\u76ee\u9304\u4e2d\u5167\u5bb9<\/td><\/tr><tr><td>w<\/td><td>\u5beb\u6b0a\u9650<\/td><td>\u53ef\u4ee5\u4fee\u6539\u6587\u4ef6\u5167\u5bb9<\/td><td>\u53ef\u4ee5\u5728\u76ee\u9304\u4e2d\u5275\u5efa\u6216\u522a\u9664\u6587\u4ef6<\/td><\/tr><tr><td>x<\/td><td>\u57f7\u884c\u6b0a\u9650<\/td><td>\u53ef\u4ee5\u57f7\u884c\u6587\u4ef6<\/td><td>\u53ef\u4ee5\u9032\u5165\u76ee\u9304<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div><\/div>\n\n\n\n<p>File      r: cat\/more\/head\/tail\/less                            Directory     r: ls<br>           w: vim\/nano                                                                     w: touch\/mkdir\/rmdir\/rm<br>           x: script\/command                                                           x: cd<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u78ba\u4fdd\u7cfb\u7d71\u8edf\u4ef6\u4fe1\u606f\u6e90\u66f4\u65b0\uff1a<br>sudo apt update<br><\/p>\n\n\n\n<p>\u5b89\u88ddUFW<br>sudo apt install ufw -y<br>sudo ufw status \uff08\u6aa2\u67e5\u7248\u672c &#8211; \u82e5\u986f\u793a inative\uff0c\u5373\u8868\u793a\u4e26\u672a\u555f\u7528\uff09<br>sudo ufw enable<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u200c<strong>\u9a8c\u8bc1\u9632\u706b\u5899\u72b6\u6001<\/strong>\u200cbashCopy Code<code>sudo ufw status verbose <\/code>\u8f93\u51fa\u5e94\u4e3a \u200c<strong><code>Status: active<\/code><\/strong>\u200c\uff0c\u5e76\u5217\u51fa\u5df2\u5141\u8bb8\u7684\u89c4\u5219\u3002<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">\u67e5\u5df2\u6253\u958b\u7684ports (Firewall)<\/h2>\n\n\n\n<p>\uff11.\u67e5\u770b\u5df2\u7ecf\u5f00\u542f\u7684\u7aef\u53e3<\/p>\n\n\n\n<p>$ sudo ufw status<\/p>\n\n\n\n<p>2.\u6253\u5f00\u7aef\u53e3<\/p>\n\n\n\n<p>$ sudo ufw allow 9123<\/p>\n\n\n\n<p>3.\u5f00\u542f\u9632\u706b\u5899<\/p>\n\n\n\n<p>$ sudo ufw enable<\/p>\n\n\n\n<p>\uff14.\u91cd\u542f\u9632\u706b\u5899<\/p>\n\n\n\n<p>$ sudo ufw reload<\/p>\n\n\n\n<p>List of ports are listening<\/p>\n\n\n\n<p>ss -tulpn | grep LISTEN<\/p>\n\n\n\n<p>\u4f46\u4ee5\u4e0a\u6c92\u6709\u6253\u958b tcp, \u6545\u7528\u53ef\u6253 port 8080\u7684tcp traffic<\/p>\n\n\n\n<p><code>sudo iptables -I INPUT -p tcp --dport 8080 -j ACCEPT<\/code><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u958b\u653e\u6240\u6709ports<br>sudo iptables -P INPUT ACCEPT &amp;&amp; sudo iptables -P FORWARD ACCEPT &amp;&amp; sudo iptables -P OUTPUT ACCEPT &amp;&amp; sudo iptables -F<\/p>\n\n\n\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=zUSM1Drh6vU&amp;t=4s\">\u8edf\u9023\u7d50<\/a><br>whereis \/ which<\/p>\n","protected":false},"excerpt":{"rendered":"<p>man: manual\u7684\u7e2e\u5beb\uff0c\u60f3\u77e5\u9053\u4e00\u500b\u6307\u4ee4\u662f\u5982\u4f55\u4f7f\u7528\uff0c\u76f4\u63a5\u7528\u5b83\u4f86\u67e5\u5c31\u53ef\u4ee5\u3002\u4f8b\u5982: man cp (\u986f\u793alinux\u6307\u4ee4 cp \u7684\u8a73\u4f7f\u7528\u65b9\u6cd5)\u3002\u7576\u7136\uff0c\u4f60\u4e5f\u53ef\u4ee5\u76f4\u63a5\u8f38\u5165 man man\u4f86\u4e86\u89e3man\u7684\u8a73\u7d30\u4f7f\u7528\u65b9\u6cd5\u3002 chmod (Change Mode)r=4, w=2, x=1 \u5c0d\u6587\u4ef6\/\u6a94\u6848\u7684\u5c6c\u6027 \u5c0d\u76ee\u9304\u7684\u5c6c\u6027 r \u8b80\u6b0a\u9650 \u53ef\u4ee5\u67e5\u770b\u6587\u4ef6\u5167\u5bb9 \u53ef\u4ee5\u5217\u51fa\u76ee\u9304\u4e2d\u5167\u5bb9 w \u5beb\u6b0a\u9650 \u53ef\u4ee5\u4fee\u6539\u6587\u4ef6\u5167\u5bb9 \u53ef\u4ee5\u5728\u76ee\u9304\u4e2d\u5275\u5efa\u6216\u522a\u9664\u6587\u4ef6 x \u57f7\u884c\u6b0a\u9650 \u53ef\u4ee5\u57f7\u884c\u6587\u4ef6 \u53ef\u4ee5\u9032\u5165\u76ee\u9304 File r: cat\/more\/head\/tail\/less Directory r: ls w: vim\/nano w: touch\/mkdir\/rmdir\/rm x: script\/command x: cd \u78ba\u4fdd\u7cfb\u7d71\u8edf\u4ef6\u4fe1\u606f\u6e90\u66f4\u65b0\uff1asudo apt update \u5b89\u88ddUFWsudo apt install ufw -ysudo ufw status \uff08\u6aa2\u67e5\u7248\u672c &#8211; \u82e5\u986f\u793a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"","ocean_second_sidebar":"","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"","ocean_custom_header_template":"","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"","ocean_menu_typo_font_family":"","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"","ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"on","ocean_gallery_id":[],"footnotes":""},"categories":[11],"tags":[],"class_list":["post-549","post","type-post","status-publish","format-standard","hentry","category-linux","entry"],"_links":{"self":[{"href":"https:\/\/blog.jason-lam.com\/index.php?rest_route=\/wp\/v2\/posts\/549","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.jason-lam.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.jason-lam.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jason-lam.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jason-lam.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=549"}],"version-history":[{"count":13,"href":"https:\/\/blog.jason-lam.com\/index.php?rest_route=\/wp\/v2\/posts\/549\/revisions"}],"predecessor-version":[{"id":783,"href":"https:\/\/blog.jason-lam.com\/index.php?rest_route=\/wp\/v2\/posts\/549\/revisions\/783"}],"wp:attachment":[{"href":"https:\/\/blog.jason-lam.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=549"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jason-lam.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=549"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jason-lam.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=549"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}