How to get a su report on Unix?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to get a su report on Unix?
# 1  
Old 07-20-2010
How to get a su report on Unix?

Hi

Users on my AIX's servers use su to several accounts. How can get a report of these account's last su login? I mean, a report of the last time these accounts were accessed by su.

thanks.
Israel
# 2  
Old 07-20-2010
Hi.

You can look at /var/adm/sulog
# 3  
Old 07-20-2010
Hi scottn,

Yes, I'm taking a look at this file but it's not easy for me to know last time a user get a su. thanks for your answer.

regards

Israel.
# 4  
Old 07-20-2010
The format is:

Code:
SU 07/20 10:50 + pts/43 user1-user2
        |      |   |     |     |
   Date & Time |   |     |  To User
               |   | From user
               | Terminal
               |
          Success (+) or
          Failure (-)

You can use grep to find users.
# 5  
Old 07-20-2010
OK, The only problem here is sulog is rotate daily, so I need to search inside these files to get last su login. I was trying to put this code inside su_user's .profile:

Quote:
(date;echo)|xargs >.lastlogin
I dont know if it's better to use /etc/profile instead .profile.

thanks scott
# 6  
Old 07-21-2010
/etc/profile is global.
.profile is private.

Depand on your request.
# 7  
Old 07-21-2010
Hi

I think is not a good idea to use any "profile" files because they only get read when users make 'su -' and no t 'su' command. I already have a script which mantain su lastlogin on a file, but now I want to make another script to show me only older su's from N days. This script gives this output:
Code:
acoxxx Lastlogin="2010/07/20 13:10"
db2t Lastlogin="2010/07/21 03:30"
db2tadm Lastlogin="2010/07/20 18:23"
eisuser Lastlogin="2010/07/20 17:26"
israel Lastlogin="2010/07/20 11:42"
nmon Lastlogin="2010/07/21 03:50"
norbac Lastlogin="2010/07/20 14:21"
oracle Lastlogin="2010/07/20 20:05"
root Lastlogin="2010/07/20 18:44"
s03josa0 Lastlogin="2010/07/20 14:10"

Here you have su lastlogin (it takes it from /var/adm/sulog). Do you have any idea how to 'grep' ONLY lines older than N days from the date given in this output?

If you want I could show the script.

Thanks
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

SQL Report from UNIX

I am trying to write a shell script which dynamically reads all the .sql (oracle sql files) from a particular directory and generates a .csv file in the target directory. I have started first with the below sample script to see if it is working but I am not able to get it executed, please help... (7 Replies)
Discussion started by: mora
7 Replies

2. Shell Programming and Scripting

How can i make a report from some insert in UNIX shell?

I have some insert in my unix shell script. This every insert has a spool (a file with datas) and a sql file with the query. I have to create a report file with three columns: The first(TAB_NAME) will contains the name of the table in wich has been done the insert, the second (STATE) will... (7 Replies)
Discussion started by: punticci
7 Replies

3. Shell Programming and Scripting

Script to report database home in unix

Hello: I am trying to build a ksh shell script which would summarize space occupied by "product" directory under /u*/app/oracle and summarize and report the total size occupied by it in one server. Environment is this... HP UNIX 11i Korn Shell some thing like ... (1 Reply)
Discussion started by: Sam1974
1 Replies

4. Homework & Coursework Questions

Report on Javascript attacks on Unix

1. The problem statement, all variables and given/known data: Prepare a report discussing from an administration and security perspective, role and function of a JavaScript within a UNIX network. You should illustrate your answer with practical examples. In particular attention should me paid to... (1 Reply)
Discussion started by: afdesignz
1 Replies

5. Shell Programming and Scripting

AutoFilter in Excel report when exporting from Unix

Hi All, Is it possible to have AutoFilter applied in the Excel Sheet which is Exported from UNix server as *.csv file. (0 Replies)
Discussion started by: rawat_me01
0 Replies

6. Shell Programming and Scripting

sql plus report under unix environment

Hi i am creating a report with file format csv using sql plus commands under unix environment. I am sending this report using mailx command to excel spread sheet. when i opened the report my columns are merged. I need to manually pull each column to see whole column results. Is there any way in... (0 Replies)
Discussion started by: raosurya
0 Replies

7. Shell Programming and Scripting

unix report

hello i just want to ask one question i am willing to create health check of my disk in unix. like a script should automatically run and genrate output in unix in beautiful report format. so is there is any way to create a beautiful report in unix like heading should be bold and big in font and... (2 Replies)
Discussion started by: shary
2 Replies

8. Shell Programming and Scripting

need help on unix script to run report

Hi All, I have a report which I am running from unix shell script using CONCSUB utility. Just for testing I put the order number in shell script as ord_low and ord_high. But Actually what is going to happen is that the order numbers will be in a file say a.txt and this CONCSUB... (2 Replies)
Discussion started by: isingh786
2 Replies

9. HP-UX

Unix sheel script to run report

Hi All, I have a report which I am running from unix shell script using CONCSUB utility. Just for testing I put the order number in shell script as ord_low and ord_high. But Actually what is going to happen is that the order numbers will be in a file say a.txt and this CONCSUB should... (0 Replies)
Discussion started by: isingh786
0 Replies
Login or Register to Ask a Question