{"id":7870,"date":"2020-05-27T08:28:20","date_gmt":"2020-05-27T00:28:20","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=7870"},"modified":"2022-06-05T15:20:25","modified_gmt":"2022-06-05T07:20:25","slug":"getent","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/getent","title":{"rendered":"getent\u547d\u4ee4 – \u67e5\u770b\u7cfb\u7edf\u6570\u636e\u5e93\u4e2d\u7684\u8bb0\u5f55\u4fe1\u606f"},"content":{"rendered":"\n

getent\u547d\u4ee4\u6765\u81ea\u4e8e\u82f1\u6587\u8bcd\u7ec4\u201cget entries\u201d\u7684\u7f29\u5199\uff0c\u5176\u529f\u80fd\u662f\u7528\u4e8e\u67e5\u770b\u7cfb\u7edf\u6570\u636e\u5e93\u4e2d\u7684\u8bb0\u5f55\u4fe1\u606f\u3002\u5373\u4fbf\u8fd9\u4e9b\u6570\u636e\u5e93\u4e0d\u662f\u672c\u5730\u7684\uff0c\u7c7b\u4f3c\u4e8eLDAP\u6216\u8005NIS\u4e5f\u53ef\u4ee5\u4f7f\u7528getent\u547d\u4ee4\u8fdb\u884c\u67e5\u770b\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>getent [\u53c2\u6570]<\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n

-s<\/td>\u8981\u4f7f\u7528\u7684\u670d\u52a1\u914d\u7f6e<\/td><\/tr>
-help<\/td>\u7ed9\u51fa\u8be5\u7cfb\u7edf\u6c42\u52a9\u5217\u8868<\/td><\/tr>
-usage<\/td>\u7ed9\u51fa\u7b80\u8981\u7684\u7528\u6cd5\u4fe1\u606f<\/td><\/tr>
-V<\/td>\u6253\u5370\u7a0b\u5e8f\u7248\u672c\u53f7<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n

\u67e5\u770b\u672c\u5730\u7684\u4e3b\u673a\u6587\u4ef6\uff08\/etc\/hosts\uff09\u4e2d\u5305\u542b\u7684\u6307\u5b9a\u57df\u540d\u4fe1\u606f\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# getent hosts linuxcool.com<\/strong>\n182.149.160.47  linuxcool.com<\/pre>\n\n\n\n

\u67e5\u770b\u672c\u5730\u7684\u5bc6\u7801\u6587\u4ef6\uff08\/etc\/passwd\uff09\u4e2d\u5305\u542b\u7684\u6307\u5b9a\u7528\u6237\u4fe1\u606f\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# getent passwd linuxprobe<\/strong>\nlinuxprobe:x:1000:1000:linuxprobe:\/home\/linuxprobe:\/bin\/bash<\/pre>\n","protected":false},"excerpt":{"rendered":"

getent\u547d\u4ee4\u6765\u81ea\u4e8e\u82f1\u6587\u8bcd\u7ec4\u201cget entries\u201d\u7684\u7f29\u5199\uff0c\u5176\u529f\u80fd\u662f\u7528\u4e8e\u67e5\u770b\u7cfb\u7edf\u6570\u636e\u5e93\u4e2d\u7684\u8bb0\u5f55\u4fe1\u606f\u3002\u5373\u4fbf\u8fd9 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/7870"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=7870"}],"version-history":[{"count":6,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/7870\/revisions"}],"predecessor-version":[{"id":10223,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/7870\/revisions\/10223"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=7870"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=7870"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=7870"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}