{"id":9590,"date":"2023-10-01T12:53:55","date_gmt":"2023-10-01T10:53:55","guid":{"rendered":"https:\/\/linux-bibel.at\/?p=9590"},"modified":"2023-10-01T12:53:56","modified_gmt":"2023-10-01T10:53:56","slug":"acct-benutzer-login-zeiten-unter-linux-anzeigen","status":"publish","type":"post","link":"https:\/\/linux-bibel.at\/index.php\/2023\/10\/01\/acct-benutzer-login-zeiten-unter-linux-anzeigen\/","title":{"rendered":"acct &#8211; Benutzer-Login-Zeiten unter Linux anzeigen"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Will man unter Linux wissen, welcher Benutzer wie lange am System gearbeitet hat &#8211; hilft die Software <strong>acct<\/strong> auf dem Terminal.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">acct installieren<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Unter auf Debian basierenden Linux-Distributionen installieren Sie diese Software ganz einfach \u00fcber die <a rel=\"noreferrer noopener\" href=\"https:\/\/www.linux-bibel-oesterreich.at\/viewtopic.php?t=10\" target=\"_blank\">Paket-Verwaltung<\/a> durch das Paket &#8222;<strong>acct<\/strong>&#8222;, andere Distributionen f\u00fchren die Software auch unter der Bezeichnung &#8222;<strong>psacct<\/strong>&#8222;.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">acct nutzen<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Unter Debian und darauf basierenden Linux-Distributionen startet die Software automatisch mit dem System &#8211; dies kontrollieren Sie am einfachsten als <a rel=\"noreferrer noopener\" href=\"https:\/\/www.linux-bibel-oesterreich.at\/viewtopic.php?t=366\" target=\"_blank\">root<\/a> \u00fcber <a rel=\"noreferrer noopener\" href=\"https:\/\/www.linux-bibel-oesterreich.at\/viewtopic.php?p=456#p456\" target=\"_blank\">Systemd<\/a> auf dem <a rel=\"noreferrer noopener\" href=\"https:\/\/www.linux-bibel-oesterreich.at\/viewtopic.php?t=3\" target=\"_blank\">Terminal<\/a> mit dem Befehl:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl status acct<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Oder eben:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl status psacct<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">L\u00e4uft Software nicht automatisch, aktivieren Sie den Autostart mit den Befehlen:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl enable acct\nsystemctl start acct<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Oder:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl enable psacct\nsystemctl start psacct<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Jetzt k\u00f6nnen wir mit dem einfachen Befehl (<em>unter Umst\u00e4nden m\u00fcssen Benutzer anderer Distributionen, au\u00dfer Debian den kompletten Befehl &#8222;<strong>psacct<\/strong>&#8220; angeben<\/em>):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ac<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">die komplette Login-Zeit aller Benutzer anzeigen lassen (<em>die Ausgabe erfolgt in Stunden<\/em>):<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac.jpeg\" rel=\"lightbox-0\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-1024x576.jpeg\" alt=\"\" class=\"wp-image-9591\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-1024x576.jpeg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-300x169.jpeg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-150x84.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-768x432.jpeg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-1536x864.jpeg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac.jpeg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Nutzen wir die Option &#8222;<strong>-d<\/strong>&#8222;, sehen wir die Login-Zeit pro Tag:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ac -d<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-1.jpeg\" rel=\"lightbox-1\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-1-1024x576.jpeg\" alt=\"\" class=\"wp-image-9592\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-1-1024x576.jpeg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-1-300x169.jpeg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-1-150x84.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-1-768x432.jpeg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-1-1536x864.jpeg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-1.jpeg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Mit der Option &#8222;<strong>-p<\/strong>&#8220; sehen wir die Login-Zeiten aller Benutzer (<em>bei mir gibt es nur mich<\/em>):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ac -p<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.linux-bibel-oesterreich.at\/download\/file.php?id=6417&amp;mode=view\"><\/a><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-2.jpeg\" rel=\"lightbox-2\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-2-1024x576.jpeg\" alt=\"\" class=\"wp-image-9593\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-2-1024x576.jpeg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-2-300x169.jpeg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-2-150x84.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-2-768x432.jpeg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-2-1536x864.jpeg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-2.jpeg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Nat\u00fcrlich k\u00f6nnen wir uns auch die Login-Zeiten einzelner Benutzer anzeigen lassen &#8211; hierzu geben wir als Option einfach den Benutzer an:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ac robert<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-3.jpeg\" rel=\"lightbox-3\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-3-1024x576.jpeg\" alt=\"\" class=\"wp-image-9594\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-3-1024x576.jpeg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-3-300x169.jpeg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-3-150x84.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-3-768x432.jpeg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-3-1536x864.jpeg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-3.jpeg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Oder wir lassen uns anzeigen, wie viel Zeit ein einzelner Benutzer an welchem Tag eingeloggt war, hierzu nutzen wir zus\u00e4tzlich die Option &#8222;<strong>-d<\/strong>&#8222;:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ac -d robert<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-4.jpeg\" rel=\"lightbox-4\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-4-1024x576.jpeg\" alt=\"\" class=\"wp-image-9595\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-4-1024x576.jpeg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-4-300x169.jpeg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-4-150x84.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-4-768x432.jpeg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-4-1536x864.jpeg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-4.jpeg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">acct besteht nicht nur aus diesem Befehl &#8222;<strong>ac<\/strong>&#8222;, denn acct kann noch mehr &#8211; sehen wir uns als Erstes alle zuletzt abgegebenen Befehle an (<em>aller Benutzer, auch die vom System<\/em>):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sa<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-5.jpeg\" rel=\"lightbox-5\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-5-1024x576.jpeg\" alt=\"\" class=\"wp-image-9596\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-5-1024x576.jpeg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-5-300x169.jpeg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-5-150x84.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-5-768x432.jpeg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-5-1536x864.jpeg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-5.jpeg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Zu Beginn in der Tabelle sehen Sie die Prozessnummer der Abgabe, Beispiel &#8222;<strong>79662<\/strong>&#8222;, es folgt die ben\u00f6tigte Zeit in Minuten &#8211; Beispiel &#8222;<strong>692.31re<\/strong>&#8222;. Anschlie\u00dfend kommt die Auslastung des Kernels &#8222;<strong>0.66cp<\/strong>&#8220; und &#8222;<strong>235921k<\/strong>&#8222;, zuletzt kommt der eigentliche Befehl.<br><br>Wollen wir uns ansehen, welche Benutzer die letzten Befehle abgegeben haben, nutzen wir zus\u00e4tzlich die Option &#8222;<strong>-u<\/strong>&#8222;:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sa -u<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-6.jpeg\" rel=\"lightbox-6\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-6-1024x576.jpeg\" alt=\"\" class=\"wp-image-9597\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-6-1024x576.jpeg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-6-300x169.jpeg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-6-150x84.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-6-768x432.jpeg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-6-1536x864.jpeg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-6.jpeg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Hier sehen Sie zu Beginn den Namen des Benutzers, der den Befehl gestartet hat &#8211; die Ausgabe erfolgt, bis Sie die Ausgabe mit <strong>Strg+c<\/strong> beenden. Mit &#8222;<strong>lastcomm<\/strong>&#8220; plus Benutzername lassen wir uns die Befehle eines einzelnen Benutzers anzeigen (<em>auch solche, die per Mausklick gestartet wurden<\/em>):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>lastcomm robert<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-7.jpeg\" rel=\"lightbox-7\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-7-1024x576.jpeg\" alt=\"\" class=\"wp-image-9598\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-7-1024x576.jpeg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-7-300x169.jpeg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-7-150x84.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-7-768x432.jpeg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-7-1536x864.jpeg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/10\/ac-7.jpeg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Mehr nat\u00fcrlich auf den jeweiligen Manpages.<\/p>\n<div class=\"pld-like-dislike-wrap pld-custom\">\r\n    <div class=\"pld-like-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-like-trigger pld-like-dislike-trigger  \" title=\"Gef\u00e4llt mir\" data-post-id=\"9590\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                            <img src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/12\/Daumen-Hoch.png\" alt=\"Gef\u00e4llt mir\" \/>\r\n            <\/a>\r\n    <span class=\"pld-like-count-wrap pld-count-wrap\">    <\/span>\r\n<\/div><div class=\"pld-dislike-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-dislike-trigger pld-like-dislike-trigger  \" title=\"Gef\u00e4llt mir nicht\" data-post-id=\"9590\" data-trigger-type=\"dislike\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                            <img src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/12\/Daumen-Runter.png\" alt=\"Gef\u00e4llt mir nicht\" \/>\r\n            <\/a>\r\n    <span class=\"pld-dislike-count-wrap pld-count-wrap\"><\/span>\r\n<\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Will man unter Linux wissen, welcher Benutzer wie lange am System gearbeitet hat &#8211; hilft die Software acct auf dem Terminal. acct installieren Unter auf Debian basierenden Linux-Distributionen installieren Sie diese Software ganz einfach \u00fcber die Paket-Verwaltung durch das Paket &#8222;acct&#8222;, andere Distributionen f\u00fchren die Software auch unter der Bezeichnung &#8222;psacct&#8222;. acct nutzen Unter Debian [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-9590","post","type-post","status-publish","format-standard","hentry","category-terminal"],"_links":{"self":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/9590","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/comments?post=9590"}],"version-history":[{"count":1,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/9590\/revisions"}],"predecessor-version":[{"id":9599,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/9590\/revisions\/9599"}],"wp:attachment":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/media?parent=9590"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/categories?post=9590"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/tags?post=9590"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}