Login and logout logs in server

Hi,
Can you please let me know how can and where we will find the logs. ie,which user is login and logout from server and by using which ip address they accessed server.
please let me know the steps and folder, file names to trace the logs from server . we are using System = SunOS 5.10.
Please let me know if you need any other details.

Just run this command:

last

Thank you for information.
I want logs from past days. Is it possible if yes please provide the command and details.

You can filter the output to show only recent entries using:

last | head -50

Change "50" to suitable number for your environment.

Once again thank you for providing information.
I ran last | head -50 command , we are getting the list upto 10 logins, is there any possibility to trace logs from two days details.

I don't understand your request... The command I provided should show most recent logins to your server. Possibly last few days. Can you post the output that you are getting after running that command?

when we used "last | head -50", we got these logs only,
i want to know logs from past two days logs atleast .

What does this command output:

last | wc -l

run the "last" command as root

---------- Post updated at 01:52 AM ---------- Previous update was at 01:51 AM ----------

14 :wink:

---------- Post updated at 01:56 AM ---------- Previous update was at 01:52 AM ----------

hm sorry i'm wrong, i can see the root logins as a normal user too!
but it is strange that you see only the gafadm user!

What I find weird in the output posted by kancherla.sree, is that normally in last output, last line says something like "wtmp begins ...". Here I don't see it, so I suspect posted lines are not complete output...

Hi,last | head -50 is the command to know the last 50 users who have logged in. If you require for last 2 days just give last | more so that you will get the list of users who have logged in from the time you have installed the box.gefadm sshd 101.36.42.55 Wed Jul 6 05:15 - 05:53 (00:38) gefadm is the user.sshd 101.36.42.55 Ip address from where it is logged in.Wed Jul 6 05:15 - 05:53 (00:38) Login and logout time.