Hi everyone,
I need a little help here. I was told I need to hand over every login from every users of every nix-like systems.
On linux it was quite easy with the lastlog utility. The output looks like this:
Code:
Username Port From Latest
tien **Never logged in**
msimard **Never logged in**
ydoucet pts/1 10.5.5.2 Wed Sep 12 14:32:24 -0400 2007
nagios **Never logged in**
nbouchard pts/0 10.9.5.60 Mon Sep 10 14:09:30 -0400 2007
ftpimg **Never logged in**
apache **Never logged in**
But on Solaris I'm having a hard time. I've found lastx, which give me every last login and it looks like this:
Code:
bash-2.05# lastx -u
Username Logins Terminal Host Last Logged in
etudia10 3 pts/8 10.9.2.114 Thu Nov 30 16:53:55 2006
etudia08 3 pts/16 10.9.2.102 Mon Dec 18 14:46:49 2006
scportca 4 pts/3 10.9.18.55 Wed Sep 12 11:32:24 2007
etudia09 3 pts/14 10.9.2.104 Thu Nov 30 16:53:29 2006
etudia11 1 pts/6 10.9.1.71 Thu Nov 30 16:54:17 2006
scolbory 4 pts/3 10.9.1.60 Wed Jun 7 15:23:51 2006
So far so good, except I don't get those that never logged in. Can someone help me with that? I'm no script guru. I tried something but it doesn't work:
Code:
cat /etc/passwd|cut -d ":" -f1
gives me the login name of all users on the system,
Code:
lastx -u|cut -d " " -f1
gives me the login name of all users that has ever logged in the system.
I tried
Code:
grep -v `lastx -u|cut -d " " -f1` /etc/passwd|cut -d ":" -f1
with no success.
Anyone?
Thank you very much.