As Peasant recommends, it is not the way to stop people connecting...
Now you have not said how they connect, at first look I would say with your issue: Using ssh...
If people spend time writing man pages, it is in the hope one will read them, why didnt you?
You would not have posted - or at least not in the same way...
in ssh man pages you would have heard of ~etc/ssh_config file and more interestingly : ~etc/sshrc file, I use ~ for I suppose path may vary depending of implementation e.g. on my HP:
ant:/usr/local/etc $ ll
total 2754
drwxr-xr-x 5 bin bin 1024 Apr 15 2011 .
drwxr-xr-x 21 bin bin 1024 May 28 2009 ..
drwxr-xr-x 2 root sys 96 Apr 15 2011 bash_completion.d
drwxr-xr-x 4 root sys 96 May 28 2009 fonts
drwxr-xr-x 2 root sys 2048 Dec 7 2004 gtk
-rw-r--r-- 1 root sys 920 Nov 12 2004 im_palette-small.pal
-rw-r--r-- 1 root sys 224 Nov 12 2004 im_palette-tiny.pal
-rw-r--r-- 1 root sys 3376 Nov 12 2004 im_palette.pal
-rw-r--r-- 1 root sys 5474 Nov 12 2004 imrc
-rw-r--r-- 1 root sys 1443 Jan 11 2011 slsh.rc
lrwxr-xr-x 1 root sys 24 Sep 18 2009 sshd_config -> /opt/ssh/etc/sshd_config
-rw-r--r-- 1 root sys 1391457 Mar 15 2007 termcap
If they are using telnet, let's see the code in /etc/profile (blotting any real names with x's). I have a script called from /etc/profile which selectively limits logins on one system according to complex rules.
If they are not using telnet, how do they connect when it is bad? How do they connect when it is good?