This was because user was getting C shell by default. When one does an rsh/rcp the shell that gets assigned in that case is also C shell. While logging into Csh, it was trying to source .tcsh file (which had some errors) which was actually checking for TERM value and since it was not defined, the execution could not complete. Hence the error.
Remedy : Just removed .csh file and it started working.