<script type="application/ld+json">{"@context":"http://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://www.simcentric.com/sc/"},{"@type":"ListItem","position":2,"name":"如何在Linux服务器上找到数据库密码？","item":"https://www.simcentric.com/sc/hong-kong-dedicated-server-sc/how-to-find-database-passwords-on-linux-servers/"}]}</script> {"id":14107,"date":"2024-08-01T14:42:41","date_gmt":"2024-08-01T06:42:41","guid":{"rendered":"https:\/\/www.simcentric.com\/uncategorized-sc\/how-to-find-database-passwords-on-linux-servers\/"},"modified":"2024-08-01T14:48:56","modified_gmt":"2024-08-01T06:48:56","slug":"how-to-find-database-passwords-on-linux-servers","status":"publish","type":"post","link":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/how-to-find-database-passwords-on-linux-servers\/","title":{"rendered":"\u5982\u4f55\u5728Linux\u670d\u52a1\u5668\u4e0a\u627e\u5230\u6570\u636e\u5e93\u5bc6\u7801\uff1f"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><p>[vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text]<\/p>\n<p>\u5bf9\u4e8e\u7ba1\u7406<a href=\"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/what-is-linux-use-cases-and-comparison-with-windows\/\" target=\"_blank\" rel=\"noopener\">Linux\u670d\u52a1\u5668<\/a>\u7684\u6280\u672f\u4eba\u5458\uff0c\u7279\u522b\u662f\u90a3\u4e9b\u53c2\u4e0e<a href=\"https:\/\/www.simcentric.com\/sc\/\" target=\"_blank\" rel=\"noopener\">\u9999\u6e2f\u670d\u52a1\u5668\u79df\u7528\u548c\u670d\u52a1\u5668\u6258\u7ba1<\/a>\u7684\u4eba\u6765\u8bf4\uff0c\u77e5\u9053\u5982\u4f55\u627e\u5230\u6570\u636e\u5e93\u5bc6\u7801\u81f3\u5173\u91cd\u8981\u3002\u672c\u6307\u5357\u63d0\u4f9b\u4e86\u9010\u6b65\u7684\u8bf4\u660e\u548c\u4ee3\u7801\u793a\u4f8b\uff0c\u5e2e\u52a9\u60a8\u6709\u6548\u5730\u5728Linux\u670d\u52a1\u5668\u4e0a\u627e\u5230\u6570\u636e\u5e93\u5bc6\u7801\u3002<\/p>\n<p>[\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text]<\/p>\n<h2><strong>\u4e86\u89e3\u6570\u636e\u5e93\u5bc6\u7801\u5b58\u50a8\u4f4d\u7f6e<\/strong><\/h2>\n<p>\u5728\u6df1\u5165\u63a2\u8ba8\u5982\u4f55\u627e\u5230\u6570\u636e\u5e93\u5bc6\u7801\u7684\u65b9\u6cd5\u4e4b\u524d\uff0c\u4e86\u89e3\u8fd9\u4e9b\u5bc6\u7801\u901a\u5e38\u5b58\u50a8\u5728\u54ea\u91cc\u662f\u5f88\u91cd\u8981\u7684\u3002\u5e38\u89c1\u7684\u6570\u636e\u5e93\u5982MySQL\u3001PostgreSQL\u548cMongoDB\u90fd\u6709\u7279\u5b9a\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u5176\u4e2d\u901a\u5e38\u4fdd\u5b58\u4e86\u5bc6\u7801\u3002<\/p>\n<p>[\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text]<\/p>\n<h2>\u5e38\u89c1\u6570\u636e\u5e93\u53ca\u5176\u914d\u7f6e\u6587\u4ef6<\/h2>\n<p>\u6bcf\u4e2a\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\uff08DBMS\uff09\u90fd\u6709\u81ea\u5df1\u5b58\u50a8\u914d\u7f6e\u4fe1\u606f\uff08\u5305\u62ec\u5bc6\u7801\uff09\u7684\u65b9\u5f0f\u3002\u4e86\u89e3\u8fd9\u4e9b\u5b58\u50a8\u4e60\u60ef\u662f\u5b9a\u4f4d\u60a8\u7684\u6570\u636e\u5e93\u51ed\u8bc1\u7684\u7b2c\u4e00\u6b65\u3002<\/p>\n<p><strong>MySQL\/MariaDB<\/strong>\uff1aMySQL\u6216MariaDB\u6700\u5e38\u89c1\u7684\u914d\u7f6e\u6587\u4ef6\u662f<code>my.cnf<\/code>\u3002\u6b64\u6587\u4ef6\u5305\u542b\u5404\u79cd\u8bbe\u7f6e\u548c\u53c2\u6570\uff0c\u5305\u62ec\u6570\u636e\u5e93\u7528\u6237\u548c\u5bc6\u7801\u3002\u60a8\u901a\u5e38\u53ef\u4ee5\u5728\u4ee5\u4e0b\u4f4d\u7f6e\u627e\u5230\u6b64\u6587\u4ef6\uff1a<\/p>\n<ul>\n<li><code>\/etc\/mysql\/my.cnf<\/code><\/li>\n<li><code>\/etc\/my.cnf<\/code><\/li>\n<li><code>\/usr\/local\/mysql\/etc\/my.cnf<\/code><\/li>\n<\/ul>\n<p><strong>PostgreSQL<\/strong>\uff1aPostgreSQL\u5c06\u5176\u914d\u7f6e\u8bbe\u7f6e\u5b58\u50a8\u5728\u591a\u4e2a\u6587\u4ef6\u4e2d\uff0c\u4f46\u4e3b\u8981\u7528\u4e8e\u5b89\u5168\u548c\u8fde\u63a5\u8bbe\u7f6e\u7684\u6587\u4ef6\u662f<code>pg_hba.conf<\/code>\u3002\u6b64\u6587\u4ef6\u53ef\u4ee5\u5728\u4ee5\u4e0b\u4f4d\u7f6e\u627e\u5230\uff1a<\/p>\n<ul>\n<li><code>\/etc\/postgresql\/<\/code><\/li>\n<li><code>\/var\/lib\/pgsql\/data\/pg_hba.conf<\/code><\/li>\n<\/ul>\n<p><strong>MongoDB<\/strong>\uff1a\u5bf9\u4e8eMongoDB\uff0c\u4e3b\u8981\u7684\u914d\u7f6e\u6587\u4ef6\u662f<code>mongod.conf<\/code>\uff0c\u901a\u5e38\u4f4d\u4e8e\uff1a<\/p>\n<ul>\n<li><code>\/etc\/mongod.conf<\/code><\/li>\n<li><code>\/usr\/local\/etc\/mongod.conf<\/code><\/li>\n<\/ul>\n<p>[\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text]<\/p>\n<h2><strong>\u67e5\u627e\u6570\u636e\u5e93\u5bc6\u7801\u7684\u65b9\u6cd5<\/strong><\/h2>\n<h3>1. \u68c0\u67e5\u914d\u7f6e\u6587\u4ef6<\/h3>\n<p>\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u662f\u67e5\u627e\u5bc6\u7801\u7684\u6700\u5e38\u89c1\u4f4d\u7f6e\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u6d41\u884c\u6570\u636e\u5e93\u7684\u6587\u4ef6\u4f4d\u7f6e\uff1a<\/p>\n<p><strong>MySQL\/MariaDB<\/strong>\uff1aMySQL\/MariaDB\u7684\u914d\u7f6e\u6587\u4ef6\u901a\u5e38\u4f4d\u4e8e<code>\/etc\/mysql\/my.cnf<\/code>\u6216<code>\/etc\/my.cnf<\/code>\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u641c\u7d22\u5bc6\u7801\uff1a<\/p>\n<pre><code>cat \/etc\/mysql\/my.cnf | grep -i 'password'<\/code><\/pre>\n<p><strong>PostgreSQL<\/strong>\uff1a\u5bf9\u4e8ePostgreSQL\uff0c\u914d\u7f6e\u6587\u4ef6\u901a\u5e38\u4f4d\u4e8e<code>\/var\/lib\/pgsql\/data\/pg_hba.conf<\/code>\u6216<code>\/etc\/postgresql\/<\/code>\u76ee\u5f55\u4e2d\u3002\u4f7f\u7528\uff1a<\/p>\n<pre><code>cat \/var\/lib\/pgsql\/data\/pg_hba.conf | grep -i 'password'<\/code><\/pre>\n<p><strong>MongoDB<\/strong>\uff1aMongoDB\u7684\u914d\u7f6e\u6587\u4ef6\u53ef\u4ee5\u5728<code>\/etc\/mongod.conf<\/code>\u4e2d\u627e\u5230\u3002\u68c0\u67e5\u5bc6\u7801\uff1a<\/p>\n<pre><code>cat \/etc\/mongod.conf | grep -i 'password'<\/code><\/pre>\n<h3>2. \u68c0\u67e5\u73af\u5883\u53d8\u91cf<\/h3>\n<p>\u6709\u65f6\u5bc6\u7801\u5b58\u50a8\u5728\u73af\u5883\u53d8\u91cf\u4e2d\u3002\u8981\u5217\u51fa\u6240\u6709\u73af\u5883\u53d8\u91cf\u5e76\u641c\u7d22\u4e0e\u5bc6\u7801\u76f8\u5173\u7684\u6761\u76ee\uff0c\u8bf7\u4f7f\u7528\uff1a<\/p>\n<pre><code>printenv | grep -i 'password'<\/code><\/pre>\n<h3>3. \u5e94\u7528\u7a0b\u5e8f\u914d\u7f6e\u6587\u4ef6<\/h3>\n<p>\u5982\u679c\u6570\u636e\u5e93\u7531\u5e94\u7528\u7a0b\u5e8f\u7ba1\u7406\uff0c\u5bc6\u7801\u53ef\u80fd\u5b58\u50a8\u5728\u5176\u914d\u7f6e\u6587\u4ef6\u4e2d\u3002\u5e38\u89c1\u76ee\u5f55\u5305\u62ec\uff1a<\/p>\n<pre><code>cat \/path\/to\/application\/config.php | grep -i 'password'<\/code><\/pre>\n<h3>4. \u4f7f\u7528<code>find<\/code>\u548c<code>grep<\/code><\/h3>\n<p>\u5982\u679c\u60a8\u4e0d\u786e\u5b9a\u786e\u5207\u4f4d\u7f6e\uff0c\u8bf7\u4f7f\u7528<code>find<\/code>\u548c<code>grep<\/code>\u641c\u7d22\u76ee\u5f55\uff1a<\/p>\n<pre><code>find \/etc -type f -exec grep -i 'password' {} \\; -print<\/code><\/pre>\n<p>[\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text]<\/p>\n<h2><strong>\u5b9e\u9645\u793a\u4f8b<\/strong><\/h2>\n<h3>1. \u67e5\u627eMySQL\u6570\u636e\u5e93\u5bc6\u7801<\/h3>\n<p>\u8981\u67e5\u627eMySQL\u5bc6\u7801\uff0c\u60a8\u53ef\u4ee5\u68c0\u67e5<code>my.cnf<\/code>\u6587\u4ef6\uff1a<\/p>\n<pre><code>cat \/etc\/mysql\/my.cnf | grep -i 'password'<\/code><\/pre>\n<h3>2. \u67e5\u627ePostgreSQL\u6570\u636e\u5e93\u5bc6\u7801<\/h3>\n<p>\u5bf9\u4e8ePostgreSQL\uff0c\u68c0\u67e5<code>pg_hba.conf<\/code>\u6587\u4ef6\uff1a<\/p>\n<pre><code>cat \/var\/lib\/pgsql\/data\/pg_hba.conf | grep -i 'password'<\/code><\/pre>\n<h3>3. \u67e5\u627eMongoDB\u6570\u636e\u5e93\u5bc6\u7801<\/h3>\n<p>MongoDB\u5bc6\u7801\u901a\u5e38\u5728<code>mongod.conf<\/code>\u4e2d\uff1a<\/p>\n<pre><code>cat \/etc\/mongod.conf | grep -i 'password'<\/code><\/pre>\n<p>[\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text]<\/p>\n<h2><strong>\u91cd\u8981\u6ce8\u610f\u4e8b\u9879<\/strong><\/h2>\n<h3>1. \u6743\u9650\u7ba1\u7406<\/h3>\n<p>\u786e\u4fdd\u60a8\u62e5\u6709\u8bbf\u95ee\u548c\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6\u7684\u5fc5\u8981\u6743\u9650\u3002\u6ca1\u6709\u9002\u5f53\u7684\u6743\u9650\uff0c\u60a8\u53ef\u80fd\u65e0\u6cd5\u67e5\u770b\u6216\u4fee\u6539\u654f\u611f\u7684\u914d\u7f6e\u7ec6\u8282\u3002<\/p>\n<h3>2. \u5b89\u5168<\/h3>\n<p>\u8c28\u614e\u64cd\u4f5c\uff0c\u9632\u6b62\u672a\u7ecf\u6388\u6743\u7684\u8bbf\u95ee\u6216\u5bc6\u7801\u6cc4\u9732\u3002\u4f7f\u7528\u52a0\u5bc6\u548c\u5b89\u5168\u7684\u5b58\u50a8\u65b9\u6cd5\u3002\u59cb\u7ec8\u9075\u5faa\u5bc6\u7801\u7ba1\u7406\u7684\u6700\u4f73\u5b9e\u8df5\uff0c\u4f8b\u5982\u4f7f\u7528\u5f3a\u800c\u552f\u4e00\u7684\u5bc6\u7801\u5e76\u5b9a\u671f\u66f4\u6362\u3002<\/p>\n<h3>3. \u5408\u89c4<\/h3>\n<p>\u5728\u5904\u7406\u654f\u611f\u4fe1\u606f\u65f6\uff0c\u9075\u5b88\u7ec4\u7ec7\u7684\u5b89\u5168\u653f\u7b56\u548c\u5408\u89c4\u8981\u6c42\u3002\u786e\u4fdd\u60a8\u4e86\u89e3\u4e0e\u6570\u636e\u5b89\u5168\u548c\u9690\u79c1\u76f8\u5173\u7684\u4efb\u4f55\u6cd5\u5f8b\u6216\u6cd5\u89c4\u8981\u6c42\u3002<\/p>\n<p>[\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text]<\/p>\n<h2><strong>\u5e38\u89c1\u95ee\u9898<\/strong><\/h2>\n<p><strong>1.\u5982\u679c\u627e\u4e0d\u5230\u914d\u7f6e\u6587\u4ef6\u600e\u4e48\u529e\uff1f<\/strong><\/p>\n<p>\u7b54\uff1a\u786e\u4fdd\u60a8\u6b63\u5728\u68c0\u67e5\u6b63\u786e\u7684\u6587\u4ef6\u8def\u5f84\u5e76\u62e5\u6709\u5fc5\u8981\u7684\u6743\u9650\u3002\u4f7f\u7528<code>find<\/code>\u547d\u4ee4\u8fdb\u884c\u66f4\u5e7f\u6cdb\u7684\u641c\u7d22\u3002\u6b64\u5916\uff0c\u67e5\u9605\u60a8\u7684\u6570\u636e\u5e93\u6587\u6863\u4ee5\u4e86\u89e3\u9ed8\u8ba4\u6587\u4ef6\u4f4d\u7f6e\u548c\u540d\u79f0\u3002<\/p>\n<p><strong>2.\u5982\u679c\u5bc6\u7801\u662f\u52a0\u5bc6\u7684\u600e\u4e48\u529e\uff1f<\/strong><\/p>\n<p>\u7b54\uff1a\u67e5\u9605\u60a8\u7684\u6570\u636e\u5e93\u6587\u6863\u6216\u7cfb\u7edf\u7ba1\u7406\u5458\u4ee5\u83b7\u53d6\u89e3\u5bc6\u65b9\u6cd5\u6216\u8bbf\u95ee\u534f\u8bae\u3002\u8bb8\u591a\u73b0\u4ee3\u6570\u636e\u5e93\u63d0\u4f9b\u5185\u7f6e\u7684\u52a0\u5bc6\u529f\u80fd\uff0c\u4e86\u89e3\u8fd9\u4e9b\u529f\u80fd\u7684\u5de5\u4f5c\u539f\u7406\u5bf9\u4e8e\u8bbf\u95ee\u60a8\u7684\u51ed\u8bc1\u81f3\u5173\u91cd\u8981\u3002<\/p>\n<p><strong>3.\u5982\u4f55\u786e\u4fdd\u641c\u7d22\u64cd\u4f5c\u7684\u5b89\u5168\u6027\uff1f<\/strong><\/p>\n<p>\u7b54\uff1a\u9650\u5236\u8bbf\u95ee\u914d\u7f6e\u6587\u4ef6\uff0c\u4f7f\u7528\u5b89\u5168\u7684\u65b9\u6cd5\uff0c\u5e76\u9075\u5faa\u5bc6\u7801\u7ba1\u7406\u7684\u6700\u4f73\u5b9e\u8df5\u3002\u59cb\u7ec8\u901a\u8fc7\u5b89\u5168\u901a\u9053\u8fdb\u884c\u641c\u7d22\u64cd\u4f5c\uff0c\u786e\u4fdd\u654f\u611f\u4fe1\u606f\u4e0d\u66b4\u9732\u7ed9\u672a\u7ecf\u6388\u6743\u7684\u7528\u6237\u3002<\/p>\n<p>[\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text]<\/p>\n<h2><strong>\u7ed3\u8bba<\/strong><\/h2>\n<p>\u5728Linux\u670d\u52a1\u5668\u4e0a\u627e\u5230\u6570\u636e\u5e93\u5bc6\u7801\uff0c\u7279\u522b\u662f\u5728\u9999\u6e2f\u670d\u52a1\u5668\u79df\u7528\u6216\u670d\u52a1\u5668\u6258\u7ba1\u73af\u5883\u4e2d\uff0c\u662f\u6280\u672f\u4eba\u5458\u7684\u4e00\u9879\u91cd\u8981\u6280\u80fd\u3002\u901a\u8fc7\u4e86\u89e3\u5bc6\u7801\u7684\u5b58\u50a8\u4f4d\u7f6e\u5e76\u9075\u5faa\u5b89\u5168\u7684\u5b9e\u8df5\uff0c\u60a8\u53ef\u4ee5\u9ad8\u6548\u4e14\u5b89\u5168\u5730\u7ba1\u7406\u60a8\u7684\u670d\u52a1\u5668\u3002<\/p>\n<p>[\/vc_column_text][\/vc_column][\/vc_row]<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>[vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text] \u5bf9\u4e8e\u7ba1\u7406Linux\u670d\u52a1\u5668\u7684\u6280\u672f\u4eba\u5458\uff0c\u7279\u522b\u662f\u90a3\u4e9b\u53c2\u4e0e\u9999\u6e2f\u670d\u52a1\u5668\u79df\u7528\u548c\u670d\u52a1\u5668\u6258\u7ba1\u7684\u4eba\u6765\u8bf4\uff0c\u77e5\u9053\u5982\u4f55\u627e\u5230\u6570\u636e\u5e93\u5bc6\u7801\u81f3\u5173\u91cd\u8981\u3002\u672c\u6307\u5357\u63d0\u4f9b\u4e86\u9010\u6b65\u7684\u8bf4\u660e\u548c\u4ee3\u7801\u793a\u4f8b\uff0c\u5e2e\u52a9\u60a8\u6709\u6548\u5730\u5728Linux\u670d\u52a1\u5668\u4e0a\u627e\u5230\u6570\u636e\u5e93\u5bc6\u7801\u3002 [\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text] \u4e86\u89e3\u6570\u636e\u5e93\u5bc6\u7801\u5b58\u50a8\u4f4d\u7f6e \u5728\u6df1\u5165\u63a2\u8ba8\u5982\u4f55\u627e\u5230\u6570\u636e\u5e93\u5bc6\u7801\u7684\u65b9\u6cd5\u4e4b\u524d\uff0c\u4e86\u89e3\u8fd9\u4e9b\u5bc6\u7801\u901a\u5e38\u5b58\u50a8\u5728\u54ea\u91cc\u662f\u5f88\u91cd\u8981\u7684\u3002\u5e38\u89c1\u7684\u6570\u636e\u5e93\u5982MySQL\u3001PostgreSQL\u548cMongoDB\u90fd\u6709\u7279\u5b9a\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u5176\u4e2d\u901a\u5e38\u4fdd\u5b58\u4e86\u5bc6\u7801\u3002 [\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text] \u5e38\u89c1\u6570\u636e\u5e93\u53ca\u5176\u914d\u7f6e\u6587\u4ef6 \u6bcf\u4e2a\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\uff08DBMS\uff09\u90fd\u6709\u81ea\u5df1\u5b58\u50a8\u914d\u7f6e\u4fe1\u606f\uff08\u5305\u62ec\u5bc6\u7801\uff09\u7684\u65b9\u5f0f\u3002\u4e86\u89e3\u8fd9\u4e9b\u5b58\u50a8\u4e60\u60ef\u662f\u5b9a\u4f4d\u60a8\u7684\u6570\u636e\u5e93\u51ed\u8bc1\u7684\u7b2c\u4e00\u6b65\u3002 MySQL\/MariaDB\uff1aMySQL\u6216MariaDB\u6700\u5e38\u89c1\u7684\u914d\u7f6e\u6587\u4ef6\u662fmy.cnf\u3002\u6b64\u6587\u4ef6\u5305\u542b\u5404\u79cd\u8bbe\u7f6e\u548c\u53c2\u6570\uff0c\u5305\u62ec\u6570\u636e\u5e93\u7528\u6237\u548c\u5bc6\u7801\u3002\u60a8\u901a\u5e38\u53ef\u4ee5\u5728\u4ee5\u4e0b\u4f4d\u7f6e\u627e\u5230\u6b64\u6587\u4ef6\uff1a \/etc\/mysql\/my.cnf \/etc\/my.cnf \/usr\/local\/mysql\/etc\/my.cnf PostgreSQL\uff1aPostgreSQL\u5c06\u5176\u914d\u7f6e\u8bbe\u7f6e\u5b58\u50a8\u5728\u591a\u4e2a\u6587\u4ef6\u4e2d\uff0c\u4f46\u4e3b\u8981\u7528\u4e8e\u5b89\u5168\u548c\u8fde\u63a5\u8bbe\u7f6e\u7684\u6587\u4ef6\u662fpg_hba.conf\u3002\u6b64\u6587\u4ef6\u53ef\u4ee5\u5728\u4ee5\u4e0b\u4f4d\u7f6e\u627e\u5230\uff1a \/etc\/postgresql\/ \/var\/lib\/pgsql\/data\/pg_hba.conf MongoDB\uff1a\u5bf9\u4e8eMongoDB\uff0c\u4e3b\u8981\u7684\u914d\u7f6e\u6587\u4ef6\u662fmongod.conf\uff0c\u901a\u5e38\u4f4d\u4e8e\uff1a \/etc\/mongod.conf \/usr\/local\/etc\/mongod.conf [\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text] \u67e5\u627e\u6570\u636e\u5e93\u5bc6\u7801\u7684\u65b9\u6cd5 1. \u68c0\u67e5\u914d\u7f6e\u6587\u4ef6 \u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u662f\u67e5\u627e\u5bc6\u7801\u7684\u6700\u5e38\u89c1\u4f4d\u7f6e\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u6d41\u884c\u6570\u636e\u5e93\u7684\u6587\u4ef6\u4f4d\u7f6e\uff1a MySQL\/MariaDB\uff1aMySQL\/MariaDB\u7684\u914d\u7f6e\u6587\u4ef6\u901a\u5e38\u4f4d\u4e8e\/etc\/mysql\/my.cnf\u6216\/etc\/my.cnf\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u641c\u7d22\u5bc6\u7801\uff1a cat \/etc\/mysql\/my.cnf | grep -i &#8216;password&#8217; PostgreSQL\uff1a\u5bf9\u4e8ePostgreSQL\uff0c\u914d\u7f6e\u6587\u4ef6\u901a\u5e38\u4f4d\u4e8e\/var\/lib\/pgsql\/data\/pg_hba.conf\u6216\/etc\/postgresql\/\u76ee\u5f55\u4e2d\u3002\u4f7f\u7528\uff1a cat \/var\/lib\/pgsql\/data\/pg_hba.conf | grep -i &#8216;password&#8217; MongoDB\uff1aMongoDB\u7684\u914d\u7f6e\u6587\u4ef6\u53ef\u4ee5\u5728\/etc\/mongod.conf\u4e2d\u627e\u5230\u3002\u68c0\u67e5\u5bc6\u7801\uff1a cat \/etc\/mongod.conf | grep -i &#8216;password&#8217; 2. \u68c0\u67e5\u73af\u5883\u53d8\u91cf \u6709\u65f6\u5bc6\u7801\u5b58\u50a8\u5728\u73af\u5883\u53d8\u91cf\u4e2d\u3002\u8981\u5217\u51fa\u6240\u6709\u73af\u5883\u53d8\u91cf\u5e76\u641c\u7d22\u4e0e\u5bc6\u7801\u76f8\u5173\u7684\u6761\u76ee\uff0c\u8bf7\u4f7f\u7528\uff1a printenv | grep -i [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/how-to-find-database-passwords-on-linux-servers\/\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":2,"featured_media":14099,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[62],"tags":[2725,2726,2724,2727,1882],"class_list":["post-14107","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hong-kong-dedicated-server-sc","tag-linux-servers-sc","tag-database-security-sc","tag-find-database-passwords-sc","tag-server-colocation-sc","tag-hong-kong-hosting-sc"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u5982\u4f55\u5728Linux\u670d\u52a1\u5668\u4e0a\u627e\u5230\u6570\u636e\u5e93\u5bc6\u7801\uff1f<\/title>\n<meta name=\"description\" content=\"\u4e86\u89e3\u5982\u4f55\u5728Linux\u670d\u52a1\u5668\u4e0a\u627e\u5230\u6570\u636e\u5e93\u5bc6\u7801\uff0c\u63d0\u4f9b\u8be6\u7ec6\u6b65\u9aa4\u548c\u4ee3\u7801\u793a\u4f8b\u3002\u9002\u5408\u7ba1\u7406\u9999\u6e2f\u670d\u52a1\u5668\u7684\u6280\u672f\u7231\u597d\u8005\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/posts\/14107\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"company\" \/>\n<meta property=\"og:title\" content=\"\u5982\u4f55\u5728Linux\u670d\u52a1\u5668\u4e0a\u627e\u5230\u6570\u636e\u5e93\u5bc6\u7801\uff1f\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/posts\/14107\" \/>\n<meta property=\"og:site_name\" content=\"\u65b0\u5929\u57df\u4e92\u8054\" \/>\n<meta property=\"article:published_time\" content=\"2024-08-01T06:42:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-08-01T06:48:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.simcentric.com\/wp-content\/uploads\/2024\/08\/sim-blog-2024-08-01-A.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"615\" \/>\n\t<meta property=\"og:image:height\" content=\"341\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5982\u4f55\u5728Linux\u670d\u52a1\u5668\u4e0a\u627e\u5230\u6570\u636e\u5e93\u5bc6\u7801\uff1f","description":"\u4e86\u89e3\u5982\u4f55\u5728Linux\u670d\u52a1\u5668\u4e0a\u627e\u5230\u6570\u636e\u5e93\u5bc6\u7801\uff0c\u63d0\u4f9b\u8be6\u7ec6\u6b65\u9aa4\u548c\u4ee3\u7801\u793a\u4f8b\u3002\u9002\u5408\u7ba1\u7406\u9999\u6e2f\u670d\u52a1\u5668\u7684\u6280\u672f\u7231\u597d\u8005\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/posts\/14107","og_locale":"zh_CN","og_type":"company","og_title":"\u5982\u4f55\u5728Linux\u670d\u52a1\u5668\u4e0a\u627e\u5230\u6570\u636e\u5e93\u5bc6\u7801\uff1f","og_url":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/posts\/14107","og_site_name":"\u65b0\u5929\u57df\u4e92\u8054","article_published_time":"2024-08-01T06:42:41+00:00","article_modified_time":"2024-08-01T06:48:56+00:00","og_image":[{"width":615,"height":341,"url":"https:\/\/www.simcentric.com\/wp-content\/uploads\/2024\/08\/sim-blog-2024-08-01-A.jpg","type":"image\/jpeg"}],"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/how-to-find-database-passwords-on-linux-servers\/#article","isPartOf":{"@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/how-to-find-database-passwords-on-linux-servers\/"},"author":{"name":"Debbie Ng","@id":"https:\/\/simcentric.com\/tc\/#\/schema\/person\/0bfc8768eb7caacbfab4a0855d805626"},"headline":"\u5982\u4f55\u5728Linux\u670d\u52a1\u5668\u4e0a\u627e\u5230\u6570\u636e\u5e93\u5bc6\u7801\uff1f","datePublished":"2024-08-01T06:42:41+00:00","dateModified":"2024-08-01T06:48:56+00:00","mainEntityOfPage":{"@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/how-to-find-database-passwords-on-linux-servers\/"},"wordCount":166,"publisher":{"@id":"https:\/\/simcentric.com\/tc\/#organization"},"image":{"@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/how-to-find-database-passwords-on-linux-servers\/#primaryimage"},"thumbnailUrl":"https:\/\/www.simcentric.com\/wp-content\/uploads\/2024\/08\/sim-blog-2024-08-01-A.jpg","keywords":["Linux\u670d\u52a1\u5668","\u6570\u636e\u5e93\u5b89\u5168","\u67e5\u627e\u6570\u636e\u5e93\u5bc6\u7801","\u670d\u52a1\u5668\u6258\u7ba1","\u9999\u6e2f\u670d\u52a1\u5668\u79df\u7528"],"articleSection":["\u9999\u6e2f\u670d\u52a1\u5668"],"inLanguage":"zh-CHN"},{"@type":"WebPage","@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/how-to-find-database-passwords-on-linux-servers\/","url":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/how-to-find-database-passwords-on-linux-servers\/","name":"\u5982\u4f55\u5728Linux\u670d\u52a1\u5668\u4e0a\u627e\u5230\u6570\u636e\u5e93\u5bc6\u7801\uff1f","isPartOf":{"@id":"https:\/\/simcentric.com\/tc\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/how-to-find-database-passwords-on-linux-servers\/#primaryimage"},"image":{"@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/how-to-find-database-passwords-on-linux-servers\/#primaryimage"},"thumbnailUrl":"https:\/\/www.simcentric.com\/wp-content\/uploads\/2024\/08\/sim-blog-2024-08-01-A.jpg","datePublished":"2024-08-01T06:42:41+00:00","dateModified":"2024-08-01T06:48:56+00:00","description":"\u4e86\u89e3\u5982\u4f55\u5728Linux\u670d\u52a1\u5668\u4e0a\u627e\u5230\u6570\u636e\u5e93\u5bc6\u7801\uff0c\u63d0\u4f9b\u8be6\u7ec6\u6b65\u9aa4\u548c\u4ee3\u7801\u793a\u4f8b\u3002\u9002\u5408\u7ba1\u7406\u9999\u6e2f\u670d\u52a1\u5668\u7684\u6280\u672f\u7231\u597d\u8005\u3002","breadcrumb":{"@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/how-to-find-database-passwords-on-linux-servers\/#breadcrumb"},"inLanguage":"zh-CHN","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/how-to-find-database-passwords-on-linux-servers\/"]}]},{"@type":"ImageObject","inLanguage":"zh-CHN","@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/how-to-find-database-passwords-on-linux-servers\/#primaryimage","url":"https:\/\/www.simcentric.com\/wp-content\/uploads\/2024\/08\/sim-blog-2024-08-01-A.jpg","contentUrl":"https:\/\/www.simcentric.com\/wp-content\/uploads\/2024\/08\/sim-blog-2024-08-01-A.jpg","width":615,"height":341,"caption":"\u5728Linux\u670d\u52a1\u5668\u4e0a\u627e\u5230\u6570\u636e\u5e93\u5bc6\u7801\u7684\u6b65\u9aa4\uff0c\u5305\u542b\u914d\u7f6e\u6587\u4ef6\u548c\u547d\u4ee4"},{"@type":"BreadcrumbList","@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/how-to-find-database-passwords-on-linux-servers\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.simcentric.com\/sc\/"},{"@type":"ListItem","position":2,"name":"\u5982\u4f55\u5728Linux\u670d\u52a1\u5668\u4e0a\u627e\u5230\u6570\u636e\u5e93\u5bc6\u7801\uff1f"}]},{"@type":"WebSite","@id":"https:\/\/simcentric.com\/tc\/#website","url":"https:\/\/simcentric.com\/tc\/","name":"Simcentric Solutions","description":"","publisher":{"@id":"https:\/\/simcentric.com\/tc\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/simcentric.com\/tc\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-CHN"},{"@type":"Organization","@id":"https:\/\/simcentric.com\/tc\/#organization","name":"Simcentric Solutions","url":"https:\/\/simcentric.com\/tc\/","logo":{"@type":"ImageObject","inLanguage":"zh-CHN","@id":"https:\/\/simcentric.com\/tc\/#\/schema\/logo\/image\/","url":"https:\/\/www.simcentric.com\/wp-content\/uploads\/2023\/06\/sim-logo-2023.png","contentUrl":"https:\/\/www.simcentric.com\/wp-content\/uploads\/2023\/06\/sim-logo-2023.png","width":800,"height":222,"caption":"Simcentric Solutions"},"image":{"@id":"https:\/\/simcentric.com\/tc\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/simcentric.com\/tc\/#\/schema\/person\/0bfc8768eb7caacbfab4a0855d805626","name":"Debbie Ng","image":{"@type":"ImageObject","inLanguage":"zh-CHN","@id":"https:\/\/secure.gravatar.com\/avatar\/9f3420f60d27329ed6e921ddaae5206353d0a7414d1abb6f1f0b32b4fd849965?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/9f3420f60d27329ed6e921ddaae5206353d0a7414d1abb6f1f0b32b4fd849965?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9f3420f60d27329ed6e921ddaae5206353d0a7414d1abb6f1f0b32b4fd849965?s=96&d=mm&r=g","caption":"Debbie Ng"}}]}},"_links":{"self":[{"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/posts\/14107","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/comments?post=14107"}],"version-history":[{"count":2,"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/posts\/14107\/revisions"}],"predecessor-version":[{"id":14111,"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/posts\/14107\/revisions\/14111"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/media\/14099"}],"wp:attachment":[{"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/media?parent=14107"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/categories?post=14107"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/tags?post=14107"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}