We have a requirement of finding which users logged into a UNIX (Solaris) box and how many times they logged in so far and their last login.
I used "last" command in my script and got everything fine but not able to capture the "year" of date/time of the users' login. Looks like "last" command doesn't display the "year" value.
Please suggest me how to go over this? is there any good alternative to "last"?
You can use "fwtmp" get the raw information from "wtmp" formatted in ascii. The full date is then available for further processing. With a bit of cleverness you can fish out details for one user. Don't expand the whole file to disc - it will be very large.
Can't check on Solaris (including the name of the accounting file), but I believe that sample usage will look something like this:
Note the space character after the username.
See "man 4 wtmp" for the file format and the meaning of the various flags so you can find the "login" records.
With a little bit of lateral thought you can select records for a user for a given year to a file and then convert the file back to wtmp format with "fwtmp" and then read that file with "last". Of course avoiding overwriting your main "wtmp" file throughout.
It is advisible to start new accounting files periodically. Even if just to stop them reaching 2 Gigabytes. We copy the file periodically to an archive filename then null the file (>filename).
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Please can you help me understand the significance of providing arguments under sh -s in
> ssh -qtt ${user}@${host} "sh -s "${version}"" < test.sh (4 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Q1
I want to allow particular user only to login into root using ssh.
I have set PermitRootLogin no for security purpose but I want to allow some of
the users to login as a root using ssh how to do this?
I have tried with Allowusers user1 user2 its working for only the user1 and... (3 Replies)
Hello,
I am new to this forums and this is my first "asking help" message!
i have 2 problems:
1- for unknown reasons the "source" command is not avalable in my system (UBUNTU). i can't either see it in my bin directory!
2- again for unknown reasons the "login.cl" file in the home... (0 Replies)
Hi,
Can anyone suggest a Unix command or c-shell algorithm to simulate to behavior of "wall" command minus the "all users"? What I'm trying to do is to send a notice to just one particular user but i dont want other remotely-logged-on users to receive the message (on the pseudo-terminals). I... (6 Replies)
Hi,
I understand that the ls command with "-l" option generates the "last modified time" of specific directory.
However, some generated results displayed the "last modified time" with detail about the last modified year, for example:
-rwxrwxrwx+ 1 smith dev 10876 May 16 2005 part2
... (6 Replies)
Hi
I have installed solaris 10 on an intel machine. Logged in as root. In CDE, i open terminal session, type login alex (normal user account) and password and i get this message
No utpmx entry: you must exec "login" from lowest level "shell" :confused:
What i want is: open various... (0 Replies)