{"id":523,"date":"2019-04-11T11:36:56","date_gmt":"2019-04-11T03:36:56","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=523"},"modified":"2019-04-29T00:05:21","modified_gmt":"2019-04-28T16:05:21","slug":"lastlog","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/lastlog","title":{"rendered":"lastlog\u547d\u4ee4 – \u663e\u793a\u7528\u6237\u6700\u8fd1\u4e00\u6b21\u767b\u5f55\u4fe1\u606f"},"content":{"rendered":"\n

lastlog\u6587\u4ef6\u5728\u6bcf\u6b21\u6709\u7528\u6237\u767b\u5f55\u65f6\u88ab\u67e5\u8be2\u3002\u53ef\u4ee5\u4f7f\u7528lastlog\u547d\u4ee4\u68c0\u67e5\u67d0\u7279\u5b9a\u7528\u6237\u4e0a\u6b21\u767b\u5f55\u7684\u65f6\u95f4\uff0c\u5e76\u683c\u5f0f\u5316\u8f93\u51fa\u4e0a\u6b21\u767b\u5f55\u65e5\u5fd7\/var\/log\/lastlog\u7684\u5185\u5bb9\u3002\u5b83\u6839\u636eUID\u6392\u5e8f\u663e\u793a\u767b\u5f55\u540d\u3001\u7aef\u53e3\u53f7\uff08tty\uff09\u548c\u4e0a\u6b21\u767b\u5f55\u65f6\u95f4\u3002\u5982\u679c\u4e00\u4e2a\u7528\u6237\u4ece\u672a\u767b\u5f55\u8fc7\uff0clastlog\u663e\u793aNever logged\u3002\u6ce8\u610f\u9700\u8981\u4ee5root\u8eab\u4efd\u8fd0\u884c\u8be5\u547d\u4ee4\u3002<\/p>\n\n\n\n

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

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n
-b <\u5929\u6570> <\/td>\u663e\u793a\u6307\u5b9a\u5929\u6570\u524d\u7684\u767b\u5f55\u4fe1\u606f <\/td><\/tr>
-t <\u5929\u6570> <\/td>\u663e\u793a\u6307\u5b9a\u5929\u6570\u4ee5\u6765\u7684\u767b\u5f55\u4fe1\u606f<\/td><\/tr>
-u <\u7528\u6237\u540d> <\/td>\u663e\u793a\u6307\u5b9a\u7528\u6237\u7684\u6700\u8fd1\u767b\u5f55\u4fe1\u606f <\/td><\/tr>
-h <\/td>\u663e\u793a\u53ec\u96c6\u4ee4\u7684\u5e2e\u52a9\u4fe1\u606f <\/td><\/tr><\/tbody><\/table>\n\n\n\n

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

\u663e\u793a\u7cfb\u7edf\u4e2d\u6240\u6709\u7528\u6237\u6700\u8fd1\u4e00\u6b21\u767b\u5f55\u4fe1\u606f \uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# lastlog
<\/pre>\n\n\n\n

\u663e\u793a\u6307\u5b9a\u5929\u6570\u524d\u7684\u767b\u5f55\u4fe1\u606f \uff1a <\/p>\n\n\n\n

[root@linuxcool ~]# lastlog -b 7
<\/pre>\n\n\n\n

\u663e\u793a\u6307\u5b9a\u5929\u6570\u4ee5\u6765\u7684\u767b\u5f55\u4fe1\u606f\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# lastlog -t 7
<\/pre>\n\n\n\n

\u663e\u793a\u6307\u5b9a\u7528\u6237\u7684\u6700\u8fd1\u767b\u5f55\u4fe1\u606f\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# lastlog -u jaking
Username Port From Latest
jaking :0 Tue Apr 9 15:54:58 +0800 2019<\/pre>\n\n\n\n

<\/p>\n","protected":false},"excerpt":{"rendered":"

lastlog\u6587\u4ef6\u5728\u6bcf\u6b21\u6709\u7528\u6237\u767b\u5f55\u65f6\u88ab\u67e5\u8be2\u3002\u53ef\u4ee5\u4f7f\u7528lastlog\u547d\u4ee4\u68c0\u67e5\u67d0\u7279\u5b9a\u7528\u6237\u4e0a\u6b21\u767b\u5f55\u7684\u65f6\u95f4\uff0c\u5e76\u683c\u5f0f\u5316\u8f93 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/523"}],"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=523"}],"version-history":[{"count":13,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/523\/revisions"}],"predecessor-version":[{"id":1610,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/523\/revisions\/1610"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=523"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=523"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=523"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}