{"id":7870,"date":"2020-05-27T08:28:20","date_gmt":"2020-05-27T00:28:20","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=7870"},"modified":"2023-04-30T08:00:24","modified_gmt":"2023-04-30T00:00:24","slug":"getent","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/getent","title":{"rendered":"getent\u547d\u4ee4 &#8211; \u67e5\u770b\u7cfb\u7edf\u6570\u636e\u5e93\u4e2d\u7684\u8bb0\u5f55\u4fe1\u606f"},"content":{"rendered":"\n<p>getent\u547d\u4ee4\u6765\u81ea\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<p><strong>\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>getent [\u53c2\u6570] [\u5bf9\u8c61]<\/p>\n\n\n\n<p><strong>\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>-i<\/td><td>\u7981\u7528IDN\u7f16\u7801<\/td><\/tr><tr><td>-s<\/td><td>\u8bbe\u7f6e\u4f7f\u7528\u7684\u670d\u52a1\u914d\u7f6e<\/td><\/tr><tr><td>--help<\/td><td>\u663e\u793a\u5e2e\u52a9\u4fe1\u606f<\/td><\/tr><tr><td>--usage<\/td><td>\u7b80\u8981\u7528\u6cd5\u4fe1\u606f<\/td><\/tr><tr><td>--version<\/td><td>\u663e\u793a\u7248\u672c\u4fe1\u606f<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n<p>\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<pre class=\"wp-block-preformatted\">[root@linuxcool ~]# <strong>getent hosts linuxcool.com<\/strong>\n182.149.160.47  linuxcool.com<\/pre>\n\n\n\n<p>\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<pre class=\"wp-block-preformatted\">[root@linuxcool ~]#<strong> getent passwd linuxprobe<\/strong>\nlinuxprobe:x:1000:1000:linuxprobe:\/home\/linuxprobe:\/bin\/bash<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>getent\u547d\u4ee4\u6765\u81ea\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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7870","post","type-post","status-publish","format-standard","hentry","category-file"],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/7870","targetHints":{"allow":["GET"]}}],"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":10,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/7870\/revisions"}],"predecessor-version":[{"id":14277,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/7870\/revisions\/14277"}],"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}]}}