Solved

unix hp login script

Posted on 2012-04-11
5
424 Views
Last Modified: 2012-04-11
experts,

i have a user acct on my unix server that fires a script when the user logs on. This is some legacy stuff that I'm trying to reverse enginer. I've found the login script that is generated in the user's home directory, but I can't figure out what fires it when he logs in. Can someone help me find out what triggers this script please?

I've looked in the following locations:
/home/user/all files in here
/etc/profile

thanks in advance.
0
Comment
Question by:telliot79
  • 3
  • 2
5 Comments
 
LVL 68

Assisted Solution

by:woolmilkporc
woolmilkporc earned 275 total points
Comment Utility
Did you use "ls -la" to examine the files in the home directory?

The initialization profiles start with a dot, and such file ares only displayed when using the "-a" flag.

Look for ".profile" or ".bash_profile" or ".bashrc" or ".login"

"/etc/bash.bashrc" and "/etc/profile" are systemwide initialization files.
0
 

Author Comment

by:telliot79
Comment Utility
i used a ll to examine the files which gives me pretty much the same results as ls -la.

the files listed were:
.cshrs
.exrc
.login
.profile
.sh_history

i searched them all, but none had the script file i was looking for.

a search of the system for the script file has pointed me to the etc/passwd file. I'm no unix expert, but it appears it's validating the password of me user in this file and then running the script from there. Is this possible?

Thanks for the prompt response.
0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 275 total points
Comment Utility
What's in the last colon-separated column of the user's entry in /etc/passwd?

That's normally the place for specifying the login shell, but it's also possible to put an arbitrary script/command there.

This script/command will be executed at login time (after successful authentication).
If the script contains "exit" the user will be logged out once the script execution terminates.
0
 

Author Comment

by:telliot79
Comment Utility
the last column is my script. after reading this - http://en.wikipedia.org/wiki/Passwd_(file) - it looks like that's what's calling it.

thanks for the help and quick responses.
0
 

Author Closing Comment

by:telliot79
Comment Utility
one step closer to knowing what I'm doing. thanks again
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now