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?
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?
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.
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.