Last, lastb: Difference between revisions
From ICO wiki
Jump to navigationJump to search
Line 28: | Line 28: | ||
=Näited= | =Näited= | ||
last käsk ilma võtmeteta | |||
<pre> | |||
kuldar@pluuto:~$ last | |||
kuldar pts/0 192.168.1.62 Fri Oct 13 21:54 still logged in | |||
kuldar tty1 Fri Oct 13 21:52 still logged in | |||
reboot system boot 3.16.0-4-amd64 Fri Oct 13 21:52 - 21:54 (00:02) | |||
kuldar tty1 Fri Oct 13 21:50 - down (00:01) | |||
reboot system boot 3.16.0-4-amd64 Fri Oct 13 21:48 - 21:52 (00:04) | |||
kuldar tty4 Fri Oct 13 21:10 - down (00:37) | |||
kuldar tty1 Fri Oct 13 20:57 - down (00:50) | |||
kuldar tty1 Fri Oct 13 20:54 - 20:57 (00:03) | |||
root tty1 Fri Oct 13 20:33 - 20:54 (00:21) | |||
mart tty1 Fri Oct 13 20:32 - 20:33 (00:00) | |||
root tty1 Fri Oct 13 20:15 - 20:32 (00:17) | |||
reboot system boot 3.16.0-4-amd64 Fri Oct 13 19:53 - 21:48 (01:54) | |||
</pre> | |||
Vaatame konkreetse kasutaja logimisi | |||
<pre> | |||
kuldar@pluuto:~$ last kuldar | |||
kuldar pts/0 192.168.1.62 Fri Oct 13 21:54 still logged in | |||
kuldar tty1 Fri Oct 13 21:52 still logged in | |||
kuldar tty1 Fri Oct 13 21:50 - down (00:01) | |||
kuldar tty4 Fri Oct 13 21:10 - down (00:37) | |||
kuldar tty1 Fri Oct 13 20:57 - down (00:50) | |||
kuldar tty1 Fri Oct 13 20:54 - 20:57 (00:03) | |||
wtmp begins Fri Oct 13 19:53:44 2017 | |||
</pre> | |||
Vaatame toimunud restartide aegasid | |||
<pre> | |||
kuldar@pluuto:~$ last reboot | |||
reboot system boot 3.16.0-4-amd64 Fri Oct 13 21:52 - 22:01 (00:09) | |||
reboot system boot 3.16.0-4-amd64 Fri Oct 13 21:48 - 21:52 (00:04) | |||
reboot system boot 3.16.0-4-amd64 Fri Oct 13 19:53 - 21:48 (01:54) | |||
wtmp begins Fri Oct 13 19:53:44 2017 | |||
</pre> | |||
Vaatame logimisi ''tty4'' peal | |||
<pre> | |||
kuldar@pluuto:~$ last 4 | |||
kuldar tty4 Fri Oct 13 21:10 - down (00:37) | |||
wtmp begins Fri Oct 13 19:53:44 2017 | |||
</pre> | |||
Vaatame logimise konkreetsel ajahetkel | |||
<pre> | |||
kuldar@pluuto:~$ last -t 20171013210000 | |||
kuldar tty1 Fri Oct 13 20:57 gone - no logout | |||
kuldar tty1 Fri Oct 13 20:54 - 20:57 (00:03) | |||
root tty1 Fri Oct 13 20:33 - 20:54 (00:21) | |||
mart tty1 Fri Oct 13 20:32 - 20:33 (00:00) | |||
root tty1 Fri Oct 13 20:15 - 20:32 (00:17) | |||
reboot system boot 3.16.0-4-amd64 Fri Oct 13 19:53 - 19:41 (23:47) | |||
wtmp begins Fri Oct 13 19:53:44 2017 | |||
</pre> | |||
=Kokkuvõte= | =Kokkuvõte= | ||
=Allikad= | =Allikad= |
Revision as of 18:41, 14 October 2017
Ülevaade
Last käsuga on võimalik vaadata, kes on hiljuti serverisse sisse loginud ning kui kaua sessioon kestnud on. Kuvatakse kasutajad, kes on süsteemi loginud peale faili /var/log/wtmp loomist.
Lastb näitab ebaõnnestunud logimiskatseid. Kuvatakse katsed, mis on tehtud peale faili /var/log/btmp loomist.
Süntaks
last [-R] [-num] [ -n num ] [-adFiowx] [ -f file ] [ -t YYYYMMDDHHMMSS ] [name...] [tty...]
lastb [-R] [-num] [ -n num ] [ -f file ] [-adFiowx] [name...] [tty...]
Võtmed
-f file kirjeldab alternatiivse faili /var/log/wtmp asemel -num kuvatavate ridade arv -n num kuvatavate ridade arv -t YYYYMMDDHHMMSS kuvab määratud ajahetkel sees olnud kasutajad -R hostname väli kuvatakse kõige all -a hostname väli kuvatakse viimases tulbas -d -F kuvab täielikud sisse ja välja logimiste ajad -i -o loeb vana tüübi wtmp faili -w kuvab täielikud kasutaja/domeeni nimed -x kuvab süsteemi shutdown’id ja runleveli muutused
Näited
last käsk ilma võtmeteta
kuldar@pluuto:~$ last kuldar pts/0 192.168.1.62 Fri Oct 13 21:54 still logged in kuldar tty1 Fri Oct 13 21:52 still logged in reboot system boot 3.16.0-4-amd64 Fri Oct 13 21:52 - 21:54 (00:02) kuldar tty1 Fri Oct 13 21:50 - down (00:01) reboot system boot 3.16.0-4-amd64 Fri Oct 13 21:48 - 21:52 (00:04) kuldar tty4 Fri Oct 13 21:10 - down (00:37) kuldar tty1 Fri Oct 13 20:57 - down (00:50) kuldar tty1 Fri Oct 13 20:54 - 20:57 (00:03) root tty1 Fri Oct 13 20:33 - 20:54 (00:21) mart tty1 Fri Oct 13 20:32 - 20:33 (00:00) root tty1 Fri Oct 13 20:15 - 20:32 (00:17) reboot system boot 3.16.0-4-amd64 Fri Oct 13 19:53 - 21:48 (01:54)
Vaatame konkreetse kasutaja logimisi
kuldar@pluuto:~$ last kuldar kuldar pts/0 192.168.1.62 Fri Oct 13 21:54 still logged in kuldar tty1 Fri Oct 13 21:52 still logged in kuldar tty1 Fri Oct 13 21:50 - down (00:01) kuldar tty4 Fri Oct 13 21:10 - down (00:37) kuldar tty1 Fri Oct 13 20:57 - down (00:50) kuldar tty1 Fri Oct 13 20:54 - 20:57 (00:03) wtmp begins Fri Oct 13 19:53:44 2017
Vaatame toimunud restartide aegasid
kuldar@pluuto:~$ last reboot reboot system boot 3.16.0-4-amd64 Fri Oct 13 21:52 - 22:01 (00:09) reboot system boot 3.16.0-4-amd64 Fri Oct 13 21:48 - 21:52 (00:04) reboot system boot 3.16.0-4-amd64 Fri Oct 13 19:53 - 21:48 (01:54) wtmp begins Fri Oct 13 19:53:44 2017
Vaatame logimisi tty4 peal
kuldar@pluuto:~$ last 4 kuldar tty4 Fri Oct 13 21:10 - down (00:37) wtmp begins Fri Oct 13 19:53:44 2017
Vaatame logimise konkreetsel ajahetkel
kuldar@pluuto:~$ last -t 20171013210000 kuldar tty1 Fri Oct 13 20:57 gone - no logout kuldar tty1 Fri Oct 13 20:54 - 20:57 (00:03) root tty1 Fri Oct 13 20:33 - 20:54 (00:21) mart tty1 Fri Oct 13 20:32 - 20:33 (00:00) root tty1 Fri Oct 13 20:15 - 20:32 (00:17) reboot system boot 3.16.0-4-amd64 Fri Oct 13 19:53 - 19:41 (23:47) wtmp begins Fri Oct 13 19:53:44 2017