Hi
Are you able to login through telnet? If that is the case, then the problem might be in the script file, which is run only in X-window mode (.TTauthority, .Xauthority). .profile is executed in both the sessions. Check for the permissions of .TTauthority, .Xauthority.
.TTauthority must have...