I do something similar by having in /etc/profile a section which uses
[ol]
[li]$LOGNAME to find out who the user is[/li]
[li][[ $(ps -p $PPID|awk 'NR==2 {print $4}') = telnetd ]] to check for telnet access (I'm not interested in ssh or su)[/li]
[li]'who' to check for the source IP Address - but you have to pin this one down using the tty command[/li]
[/ol]
And only if the relevant conditions are met are they allowed to log in.
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.