Sponsored Content
Homework and Emergencies Homework & Coursework Questions Help with unix commands for user logins Post 302636409 by bakunin on Monday 7th of May 2012 11:32:48 AM
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:
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
All times are GMT -4. The time now is 11:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy