Unix iTOps Tube

Monday, May 7, 2012

Help with unix commands for user logins

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!

1. The problem statement, all variables and given/known data:

List the last 3 times you logged into the hottub and the command(s) you used to obtain this information

2. Relevant commands, code, scripts, algorithms:

3. The attempts at a solution (include all code and scripts):

1) last agreen1 |head -n 3

2) tail -n 100 messages|grep agreen1

4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):

University of Illinois, O'Reilly School of Technology, Kelly Hoover, Linux/Unix 1: The Unix file system

Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).

So basically I telnet into a server called cold1 then ssh into a server called hottub, and then into one called bubble. I have root privilege in my bubble.

When i use the "last" command I was told that it only shows me where I have come from not where I am. If Im logged into the bubble it will show me my hottub logins. If Im on huttub it will show me my cold1 logins. So thats not the way.

So I logged into the hottub server and used cd /var/log to get to the log diectory. Then used the above command: tail -n 100 messages|grep agreen1.

This what my instructor said about my failed attempt: "You have the idea however we have a simpler command with a simpler output, that just shows logins and can specify only the last 3 logins.

Thanks for your help.

Al green

No comments:

Post a Comment