Help with unix commands for user logins

 
Thread Tools Search this Thread
Homework and Emergencies Homework & Coursework Questions Help with unix commands for user logins
# 8  
Old 05-07-2012
Quote:
Originally Posted by iw2198
Sorry about that. I almost did post it.
No problem.


Quote:
Originally Posted by iw2198
I have the man page you posted above in the first server, cold1.
Quote:
Originally Posted by iw2198
Im not seeing anything in the last man page.
Then read again. agama even mentioned the option you might find interesting.

I hope this helps.

bakunin
# 9  
Old 05-07-2012
Yeah I get that I think.

Code:
bubble151:~$ last -n 3 agreen1
agreen1  pts/0        hottub.private.u Mon May  7 07:51   still logged in   
agreen1  pts/0        hottub.private.u Mon May  7 05:04 - 05:14  (00:09)    
agreen1  pts/0        hottub.private.u Sun May  6 21:22 - 22:12  (00:49)    

or
bubble151:~$ last -n 3 -R agreen1
agreen1  pts/0        Mon May  7 07:51   still logged in   
agreen1  pts/0        Mon May  7 05:04 - 05:14  (00:09)    
agreen1  pts/0        Sun May  6 21:22 - 22:12  (00:49)

The problem Im having is that Im being told basically that I need to logged in to the hottub server and run whatever command and see my logins from there.

The above code is from when I logged in on my bubble and shows my activity on the hottub. The info in the above code should be what i need (informationally). Im going to email her in a bit.

Well I did learn that I don't have to pipe last like i did in my first post.Smilie

I still feel like this.Smilie At least now I have a few questions I can ask my instructor.

Thank you. I appreciate the help from both of you.
# 10  
Old 05-07-2012
Quote:
Originally Posted by iw2198

Code:
bubble151:~$ last -n 3 agreen1

or
Code:
bubble151:~$ last -n 3 -R agreen1

correct. If you include "-R" is merely a matter of taste, but you got the drift.

Quote:
Originally Posted by iw2198
The problem Im having is that Im being told basically that I need to logged in to the hottub server and run whatever command and see my logins from there.
Then issue the command there, simply. If you read the man page careful enough you will notice the following:

There is a file called /var/tmp/wtmp, where every login/logóut-activity is stored. This file has a certain format and last is designed to retrieve information from this file and put it in readable form. You can even create a file of this certain format yourself and let "last" work on that (with the "-f" option). As every system maintains this log you can query it on every system.

Quote:
The above code is from when I logged in on my bubble and shows my activity on the hottub.
NO!!!

It shows, that you have logged in to bubble coming from hottub. You logged in to hottub, then logged in to bubble from there. For the bubble system, you are coming from hottub, while for the hottub system you are coming from whichever system to used to access it.

Think of it as a series of rooms (the systems) connected by doors (the network connections). Every room "knows" which door you came through when you entered it, but not more: if you start in room A, go to room B and from there to room C, room C will record "has come from room B", room B will record "has come from room A" and room A will - well, it will know you started there, because you came from nowhere else.

The equivalent of "knowing you started there" is having some local terminal instead of a network address as "coming from". Compare your output (network connection) to when i use "last" on the laptop i am writing this. Notice the "pts" and "tty" devices instead of a network address. These are local (pseudo)-terminals instead of network connections.:

Code:
# last
bakunin  pts/0        :0.0             Mon May  7 17:25   still logged in   
bakunin  pts/0        :0.0             Mon May  7 06:50 - 07:02  (00:12)    
bakunin  pts/0        :0.0             Mon May  7 06:42 - 06:43  (00:00)    
bakunin  tty7         :0               Sat May  5 20:21   still logged in   
reboot   system boot  2.6.35-22-generi Sat May  5 20:21 - 17:25 (1+21:04)

Quote:
Well I did learn that I don't have to pipe last like i did in my first post.Smilie

I still feel like this.Smilie
Don't give up. Once you managed some basic understanding you are in for one of the most wonderful experiences in life. Working with Unix is like playing an instrument - the better you get the more beauty you reveal and the more things you find that you can still learn while the topic gots even more interesting with every answered question.

I hope this helps.

bakunin
This User Gave Thanks to bakunin For This Post:
# 11  
Old 05-07-2012
Everything you have posted has helped. I cant thank you enough. It has been frustrating me because of a misunderstanding in a few things my instructor said to me in emails. I thought she was saying that my first try using last was wrong and my second try using tail was on the right track. but thats not what she meant. We exchanged emails today.

I love this class Im taking. This one question is the difference between 96% done and 100% done my class and can move on to the next one. ha ha It figures right?
I am much more comfortable erecting steel building that typing terminal commands!Smilie
I do love learning. I'll be going back to review and read more man pages. Ill update this when I figure it out.

Thanks again
# 12  
Old 06-02-2012
Sorry it took so long to post. Its was just as you stated in the post above. I had been looking for the output to say you have entered room B at such and such a time. But instead its like saying you already know where you are. It tells you when you got there and from where.


Thanks again
# 13  
Old 06-06-2012
Hi

you can try last -an | head
last just read /var/adm/wtmpx file.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Disable multiple ssh logins for an OS user in Solaris

Hi folks, I am fairly a beginner when it comes to Solaris OS administration, but part of my job somehow has scope to provide L1-level of OS administration over a few solaris servers. Now, we have a requirement to limit the number of simultaneous ssh logins/sessions to the server, sort of... (0 Replies)
Discussion started by: engrcha
0 Replies

2. Solaris

[Resolved] Strange Issue with user logins

Ok got a strange one here. None of my user accounts are able to login into the system. When trying to ssh to the server i get the following. Could not chdir to home directory /home/<homedir>: Permission denied /bin/sh: Permission denied I checked the permissions on the home directory and even... (7 Replies)
Discussion started by: JoeDirte
7 Replies

3. Red Hat

Limit root user of SSH logins

Hi team, I tried to modify the /etc/security/limits.conf file to limit the root user for more one login. I added the line in limits.conf file like: @root hard maxlogins 1 I also tried to modify /etc/ssh/sshd_config to limit the root userlogin by adding this: ... (10 Replies)
Discussion started by: leo_ultra_leo
10 Replies

4. Solaris

Configure Solaris to accept Active Directory user logins

Is it possible to configure a Solaris server to authenticate users against an Active Directory server when logging in via ssh? I've seen some docs out there, I've followed their instructions, but it does not work. And I'm beginning to wonder if it is possible or even supported by Oracle. The... (2 Replies)
Discussion started by: BG_JrAdmin
2 Replies

5. Shell Programming and Scripting

Script that outputs user logins sorted by duration

Hello, I want to write a script that takes a username as input and outputs the user's logins sorted by duration. Also I want to exclude the "still logged in" entries. I use the "last" command but Im having problems sorting the entries based on the duration. Can you help me? Thanks a lot =) (4 Replies)
Discussion started by: ddante
4 Replies

6. Solaris

User Logins

Is the below logins are needed in the machine..... nuucp , uucp ,smmsp , svctag , listen , webservd , ip ( We are not using printers), Can you help in these? Regards, kumar (3 Replies)
Discussion started by: rajeshkumarvg
3 Replies

7. AIX

Logging user logins

I want to know how I can turn off and turn on login logging. We have a server that appears to have stopped logging user logins. Running the who command shows nothing and the last command shows no logins for a month. The var/adm/wtmp file isn't full and there is plenty of space in the var file... (2 Replies)
Discussion started by: daveisme
2 Replies

8. Solaris

stay in multi user mode but stop logins to system?

I want to apply patches in multiuser mode but stop logins of other users while I do it? What is the best way to do this? I will be connected to the system via a putty session over a serial cable from another system (console is messed up)... Should I put in a dummy passwd and shadow file... (7 Replies)
Discussion started by: NewSolarisAdmin
7 Replies

9. UNIX for Dummies Questions & Answers

Linmit user logins

Hello everyone, traditionally a user can log in on more than one machine as much as they want. In AIX 4.3, Is there a way to make it so that if the user is already logged on, the system will not let them log on, therefor not run their logon profile script again? (limit the user to one machine at a... (1 Reply)
Discussion started by: raidzero
1 Replies

10. Shell Programming and Scripting

Trapping user logins in python ( post #1)

I am writting a daemon in python which should start at system start up with all inet.d services on an NIS server. Then it should listen to any user login and then start a new process for that user on his login which will continue throughout his entire session. Can anyone give any help or any... (1 Reply)
Discussion started by: thinkgeek
1 Replies
Login or Register to Ask a Question