1833051 Members
2319 Online
110049 Solutions
New Discussion

Re: tcsh and telnet

 
Chakravarthi
Trusted Contributor

tcsh and telnet

Hi all,

I'm using tcsh as my default shell, when i do rlogin or su or telnet -l user to a machine the user variable is getting set properly, but when i just do telnet to a machine the user variable which i'm not seeing is not the username as what i have logged in.

When using tcsh what are the startup files, and who sets this user variable ???

thanks
chakri
4 REPLIES 4
Christian Gebhardt
Honored Contributor

Re: tcsh and telnet

Hi

look at man tcsh:

Startup and shutdown
A login shell begins by executing commands from the system files /etc/csh.cshrc and /etc/csh.login. It
then executes commands from files in the user's home directory: first ~/.tcshrc (+) or, if ~/.tcshrc is
not found, ~/.cshrc, then ~/.history (or the value of the histfile shell variable), then ~/.login, and
finally ~/.cshdirs (or the value of the dirsfile shell variable) (+). The shell may read
/etc/csh.login before instead of after /etc/csh.cshrc, and ~/.login before instead of after ~/.tcshrc
or ~/.cshrc and ~/.history, if so compiled; see the version shell variable. (+)

Non-login shells read only /etc/csh.cshrc and ~/.tcshrc or ~/.cshrc on startup.


Chris
Chakravarthi
Trusted Contributor

Re: tcsh and telnet

I have checked all the files,
every thing seems to be fine.
Bill Hassell
Honored Contributor

Re: tcsh and telnet

If your user variables are being set in .cshrc or /etc/csh.login, then you must perform a normal login to execute these files. su without the - option (su - user_name) will never run these files and is a severe security risk. Never use su without the - option since you will not have a standard environment.

rlogin should run these profiles but remsh will not. The telnet -l option indicates that you have the TAC User ID feature enabled and thus, telnet will act like rlogin/remsh and may bypass the profile execution. Check the man page for telnetd concerning TAC.


Bill Hassell, sysadmin
Chakravarthi
Trusted Contributor

Re: tcsh and telnet

USER variable is not set anywhere,, system is setting it, it working fine on other servers,,