Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

use .profile to determine IP address and kill session based on it

Status
Not open for further replies.

WiccaChic

Technical User
Joined
Jan 21, 2004
Messages
179
Location
US
Hi all. What could I include in a .profile script that would examine a users IP address and based on that, do things like log an entry in a file or even kill the session?
 
Aernt you helpful. Good luck finding a job...everyone loves that attitude of academic nose-tweaking.
 
I allways like to help when I understand the question.
Multiple users may have the same IP and a single User may have multiple IPs.
Are you talking about rsh or telnet?

seeking a job as java-programmer in Berlin:
 
The "finger" command is used to lookup info for a user. Check your man pages to see what's available, but you should be able to find the user's host name.
 
Wiccachic - do give Stefan a break here, he was only trying to help!
 
You may take a look at the lsof utility.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Um, stefanwagner's reply was perfectly valid and contained information helpful to you if you bothered to look. At the very least, it contained the information that your question was not well stated in the first place.

I can only imagine you're talking about running an ISP of sorts where people dial up and log on, or you're using a server and some thin-clients. The only way I reached that conclusion was by reading your mind. Not everyone is psychic, though, and you shouldn't take that attitude when someone tries to help you and infers the wrong thing from your question. Everyone loves that attitude, too, especially me.

Also, upon recieving a reply, if you find it unsatisfactory, you'd be much better off restating your question than giving an equally unhelpful response such as yours.


If I'm right about what you're trying to do, you're trying do it the wrong way, anyway. Look at the configuration for whatever server you're using to grant your remote access. That's where you'll find the correct way to deny someone access or log usage based on IP.

The .profile would run for people who log on locally as well as remotely. Your IP-detection thing would be pointless for them. Most people are used to local log ins, by the way, which explains the response of, "A user has no IP."

It would also be easy to bypass something in my .profile designed to keep me from logging in. I could just comment it out.


And please don't give me any attitude in the case that I didn't guess exactly what you meant.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top