SSL: 1
Warning: Cannot modify header information - headers already sent by (output started at /www/blog/wp-includes/load.php:1646) in /www/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1893
Warning: Cannot modify header information - headers already sent by (output started at /www/blog/wp-includes/load.php:1646) in /www/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1893
Warning: Cannot modify header information - headers already sent by (output started at /www/blog/wp-includes/load.php:1646) in /www/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1893
Warning: Cannot modify header information - headers already sent by (output started at /www/blog/wp-includes/load.php:1646) in /www/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1893
Warning: Cannot modify header information - headers already sent by (output started at /www/blog/wp-includes/load.php:1646) in /www/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1893
Warning: Cannot modify header information - headers already sent by (output started at /www/blog/wp-includes/load.php:1646) in /www/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1893
Warning: Cannot modify header information - headers already sent by (output started at /www/blog/wp-includes/load.php:1646) in /www/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1893
Warning: Cannot modify header information - headers already sent by (output started at /www/blog/wp-includes/load.php:1646) in /www/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1893
{"id":11,"date":"2015-08-19T22:26:10","date_gmt":"2015-08-19T14:26:10","guid":{"rendered":"https:\/\/blog.weskiller.com\/?p=11"},"modified":"2016-12-07T10:37:48","modified_gmt":"2016-12-07T02:37:48","slug":"sshd-%e5%ae%89%e5%85%a8%e6%8e%aa%e6%96%bd","status":"publish","type":"post","link":"https:\/\/blog.gamein.vip\/ssh-security.html","title":{"rendered":"ssh\u5b89\u5168\u63aa\u65bd"},"content":{"rendered":"
\u4ee5\u524d\u4e70\u8fc7\u8bb8\u591avps,\u56fd\u5185\uff0c\u56fd\u5916\u7684\u90fd\u6709\u3002\u65e0\u8bbaidc\u4f9b\u5e94\u5546\u9632\u706b\u5899\u505a\u7684\u591a\u597d\uff0c\u7b56\u7565\u6709\u591a\u590d\u6742\uff0c\u603b\u662f\u4f1a\u6709\u5f88\u591a\u8fde\u7eed\u7684IP\u6bb5\u4e0d\u505c\u7684\u626b\u63cf\u4f60\u7684\u4e3b\u673a\u670d\u52a1\u7aef\u53e3\uff0c\u7279\u522b\u662fLinux\u7cfb\u7edf\u7684\u9ed8\u8ba4\u8fdc\u7a0b\u7ba1\u7406\u7aef\u53e322
\n\u6700\u5f00\u59cb\u535a\u4e3b\u4e5f\u662f\u653e\u7f6e\u4e0d\u7ba1\uff0c\u5e76\u6ca1\u6709\u8d77\u591a\u5927\u7591\u5fc3
\n\u4f46\u662f\u9ebb\u70e6\u5c31\u6765\u4e86\u3002\u4e0d\u5230\u4e00\u5468\u7684\u65f6\u95f4 ssh\u7cfb\u7edf\u65e5\u5fd7\u8fbe\u5230\u4e8610G\uff0c\u5f53\u65f6\u6211\u4e00\u770b\u78c1\u76d8\u7a7a\u95f4\u5c31\u61f5\u4e86\uff0c\u521a\u4e70\u7684\u4e3b\u673a\uff0c\u4ec0\u4e48\u670d\u52a1\u90fd\u6ca1\u653e\uff0c\u600e\u4e48\u78c1\u76d8\u5c31\u589e\u52a0\u4e86\u9019\u4e48\u591a
\n\u7ec6\u7ec6\u68c0\u67e5\u4e0b\u624d\u53d1\u73b0\u662f\/var\/log\/secure \u8fd9\u4e2a\u8bb0\u5f55ssh\u767b\u9646\u60c5\u51b5\u7684\u65e5\u5fd7\u5360\u7528\u4e86\u7a7a\u95f4
\n\u518d\u68c0\u67e5\u5185\u5bb9\uff0c\u53d1\u73b0\u5168\u662f\u8bb0\u5f55\u7684ssh\u767b\u9646\u5931\u8d25\u7684\u65e5\u5fd7\uff0c\u6050\u6016\u7684\u662f\u67d0\u51e0\u4e2aIP\u7684\u9a8c\u8bc1\u5bc6\u7801\u7684\u6b21\u6570\u8fbe\u5230\u4e86\u5341\u51e0\u4e07\u6b21
\n\u5438\u53d6\u6559\u8bad\uff0c\u5220\u9664\u4e86secure\u65e5\u5fd7\u3002\u4f46\u662f\u6cbb\u6807\u4e0d\u6cbb\u672c\uff0c\u51b3\u5b9a\u5bf9ssh\u5b89\u5168\u82b1\u4e9b\u5fc3\u601d<\/p>\n
No1 \u4fee\u6539ssh\u7aef\u53e3\u53f7<\/span><\/p>\n \u66f4\u6362ssh\u662f\u4e00\u4e2a\u5f88\u5b9e\u7528\u7684\u65b9\u6cd5\uff0c\u76f4\u63a5\u7565\u53bb\u4e86\u767e\u5206\u4e4b80\u4ee5\u4e0a\u7684\u6076\u610f\u626b\u63cf\u3002\u64cd\u4f5c\u4e5f\u5f88\u7b80\u5355\uff0c\u7f3a\u70b9\u662f\u5269\u4e0b\u767e\u5206\u4e4b20\u8fd8\u662f\u4f1a\u4fa6\u63a2\u5230\u8fdc\u7a0b\u7aef\u53e3\uff0c\u6ca1\u6709\u6839\u6cbb<\/p>\n No2 \u9488\u5bf9\u56fa\u5b9aIP\u5f00\u53d1\u7aef\u53e3<\/span><\/p>\n \u8fd9\u79cd\u65b9\u6cd5\u662f\u5f88\u591a\u4f01\u4e1a\u4f7f\u7528\u7684\u65b9\u5f0f\uff0c\u6548\u679c\u597d\uff0c\u5b89\u5168\uff0c\u80fd\u6839\u6cbb\u6076\u610f\u626b\u63cf\uff0c\u64cd\u4f5c\u4e5f\u76f8\u5bf9\u7b80\u5355 \u95ee\u9898\u662f\u5982\u679c\u6ca1\u6709\u56fa\u5b9a\u7684IP\u9700\u8981\u642d\u5efaVPN\u8df3\u677f<\/p>\n\r\n#vi \/etc\/ssh\/sshd_config\r\nPort $port\r\n<\/pre>\n
\n\u5728\u9632\u706b\u5899\u4e2d\u6dfb\u52a0\u89c4\u5219<\/p>\n\r\niptables -t filter -I INPUT -s $IP -p tcp -m tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT\r\n<\/pre>\n