远程连接Linux云服务器报错:Permission denied
Last updated
2023-01-28 10:45:38
{"value":"### 1.\u95ee\u9898\u73b0\u8c61\n\n\u8fdc\u7a0b\u8fde\u63a5Linux\u4e91\u670d\u52a1\u5668\u62a5\u9519\uff1aPermission denied\n\n\t\u8bf4\u660e\uff1a\n\t\u4fee\u6539\u6b64\u95ee\u9898\u9700\u8981\u91cd\u542f\u8fdb\u5165\u6551\u63f4\u6a21\u5f0f\uff0c\u8bf7\u8bc4\u4f30\u98ce\u9669\u540e\u8fdb\u884c\u64cd\u4f5c\u3002\n\t\u672c\u8282\u64cd\u4f5c\u6d89\u53ca\u4e91\u670d\u52a1\u5668\u91cd\u542f\u64cd\u4f5c\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u4e1a\u52a1\u4e2d\u65ad\uff0c\u8bf7\u8c28\u614e\u64cd\u4f5c\u3002\n\n### 2.\u6839\u56e0\u5206\u6790\n\n\u200b\t\/etc\/security\/limits.conf\u4e2d\u7684nofile \u7528\u6765\u8bbe\u7f6e\u7cfb\u7edf\u5141\u8bb8\u6253\u5f00\u7684\u6700\u5927\u6587\u4ef6\u6570\u76ee\uff0c\n\u200b\t\u5982\u679cnofile\u503c\u5927\u4e8ePermissionDenied.png\u5185\u6838\u8bbe\u7f6e\u7684fs.nr_open\u53c2\u6570\u503c\uff08\u9ed8\u8ba4\u4e3a1048576\uff09\uff0c\n\u200b\t\u4f1a\u5bfc\u81f4\u767b\u5f55\u6821\u9a8c\u9519\u8bef\uff0c\u5bfc\u81f4\u767b\u5f55\u4e91\u670d\u52a1\u5668\u65f6\u63d0\u793a\u201cPermission denied\u201d\n\n### 3.\u5904\u7406\u65b9\u6cd5\n\n**3.1 \u8fdb\u5165\u4e91\u670d\u52a1\u5668\u7684\u5355\u7528\u6237\u6a21\u5f0f\u3002**\n\n\u200b\t\u4ee5CentOS 7\u64cd\u4f5c\u7cfb\u7edf\u4e3a\u4f8b\uff1a\n\u200b\ta.\u5355\u51fb\u201c\u8fdc\u7a0b\u767b\u5f55\u201d\u3002\n\u200b\tb.\u5355\u51fb\u8fdc\u7a0b\u767b\u5f55\u64cd\u4f5c\u9762\u677f\u4e0a\u65b9\u7684\u201c\u53d1\u9001CtrlAltDel\u201d\u6309\u94ae\uff0c\u91cd\u542f\u865a\u62df\u673a\u3002\n\u200b\tc.\u6309\u4e0a\u65b9\u5411\u952e\uff0c\u963b\u6b62\u7cfb\u7edf\u81ea\u52a8\u7ee7\u7eed\uff0c\u5728\u51fa\u73b0\u5185\u6838\u9009\u9879\u65f6\u6309\u5b57\u6bcd\u952ee\u8fdb\u5165\u5185\u6838\u7f16\u8f91\u6a21\u5f0f\u3002\n\u200b\td.\u627e\u5230linux16\u884c\u672b\u5c3e\uff0c\u5220\u9664\u4e0d\u9700\u8981\u52a0\u8f7d\u7684\u53c2\u6570\u5230ro\u53c2\u6570\u3002\n\u200b\te.\u4fee\u6539ro\u4e3arw\uff0c\u4ee5\u8bfb\u5199\u65b9\u5f0f\u6302\u8f7d\u6839\u5206\u533a\u3002\n\u200b\tf.\u5e76\u6dfb\u52a0rd.break\uff0c\u7136\u540e\u6267\u884cCtrl+X\n\u200b\tg.\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u5207\u6362\u81f3\/sysroot\u76ee\u5f55\u3002\n\u200b\t# chroot \/sysroot\n\u200b\t\n\n**3.2 \u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff0c\u67e5\u8be2\u5185\u6838\u7684fs.nr_open\u503c\u3002**\n\n\u200b\tsysctl fs.nr_open\n\u200b\t\n\n**3.3 \u7f16\u8f91 \/etc\/security\/limits.conf\uff0c\u4fee\u6539\u914d\u7f6e\u7684nofile\u503c\u4e3a\u5408\u7406\u7684\u503c\uff0c\u9700\u5c0f\u4e8e2\u4e2d\u67e5\u8be2\u7684fs.nr_open\u503c\uff0c\u4f8b\u598265535\u3002**\n\n\u200b\tvi \/etc\/security\/limits.conf\n\n**3.4 \u91cd\u542f\u670d\u52a1\u5668\uff0c\u91cd\u8bd5\u8fde\u63a5\u4e91\u670d\u52a1\u5668**\n\n\t\u8bf4\u660e\uff1a\n\tlimits.conf \u6587\u4ef6\u5b9e\u9645\u662fLinux PAM\uff08\u63d2\u5165\u5f0f\u8ba4\u8bc1\u6a21\u5757\uff0cPluggable Authentication Modules\uff09\u4e2dpam_limits.so \u7684\u914d\u7f6e\u6587\u4ef6\u3002\u66f4\u591a\u8be6\u7ec6\u914d\u7f6e\u4fe1\u606f\u8bf7\u67e5\u770bman\u624b\u518c\uff0c\u6267\u884c\uff1a\n\tman limits.conf"}