LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-10-2005, 12:54 AM   #1
movitto
Member
 
Registered: May 2004
Distribution: Fedora 4 and Slackware
Posts: 179

Rep: Reputation: 30
Question SSH Displaying Environment Variables


Hi, I have successfully configured a sshd server and got it running. The problem lies in the fact that whenever clients connect to it, they get the following output:

Last login: Tue Aug 9 12:29:58 2005 from 111.222.333.444
Environment:
USER=xxx
LOGNAME=xxx
HOME=/home/xxx
PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin
MAIL=/var/mail/xxx
SHELL=/bin/bash
SSH_CLIENT=111.222.333.444 3644 22
SSH_CONNECTION=111.222.333.444 3644 111.222.333.555 22
SSH_TTY=/dev/pts/0
TERM=xterm
xxx@hostname:~$

I would like to disable these variables from being displayed. I believe its a misconfiguration or similar problem with sshd because of the three SSH_ variables in the output. I doubt it is a bash related problem because when I log into the server via physical access (eg me sitting at the terminal) I dont get that output.

This is probably simply something I overlooked and if anyone knows how to do this, a response would greatly be appreciated. Thank you.
 
Old 08-11-2005, 10:28 AM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 125Reputation: 125
Maybe there is something causing this in /etc/ssh/environment (or /etc/environment, depending on install) or ~/.ssh/environment, OR ~/.sshrc. Or a conditional in the bash startup scripts.
 
Old 08-11-2005, 11:23 PM   #3
movitto
Member
 
Registered: May 2004
Distribution: Fedora 4 and Slackware
Posts: 179

Original Poster
Rep: Reputation: 30
Thanks for your reply Matir. I dont think its a problem with any of those scripts because i dont event have an /etc/environment or an /etc/ssh/environment on my system. Also no users have a .ssh directory in their home directory. I also checked /etc/profile and any user's .bashrc files and none call the 'env' or 'set' or any other command that would display the environment variables. In addition, this happens for all users, regardless of what is in their home (some users have no files in their directory).
I am really stumped on this one. Are there any other files that I need to check or commands to check for.

Any more suggestions would be appreciated. Thanks.
 
Old 08-12-2005, 08:53 AM   #4
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 125Reputation: 125
Very odd. I'm not aware of any sshd configuration option that would cause this, but perhaps there is one... I'll look into that when I get to work.
 
Old 08-12-2005, 10:50 AM   #5
movitto
Member
 
Registered: May 2004
Distribution: Fedora 4 and Slackware
Posts: 179

Original Poster
Rep: Reputation: 30
Once again thanks for your reply matir. I believe I found the source of the problem. It seems that the problem did not lie in sshd but in the client applications I was using to connect to the server. When doing my testing, I was connecting to the server via mindterm and putty, both of which are ssh clients for windows. I noticed that when in mindterm, I had the terminal set to emulate xterm, but when i changed it to emulate a different terminal, such as te standard linux terminal, the non-desired output was no longer displayed. To verify this, I logged into linux on my client machine (its a dual boot) and ssh'd from the command line, and achieved the desired result (eg. no envrionment output).

The thing that confuses me is that once I log into X, start up Xterm, and issue a ssh to my server I do not get the environment variable output. Possibly this is due to a different in versions between the xterms on my linux partition and the emulation that mindterm / putty runs. Im not sure exactly why this happens, and its not a complete explanation but its good enough for me for now. Thanks for your help Matir, and I hope this helps anyone in a similar situation in the future (it annoyed the crap out of me :-) )
 
Old 08-12-2005, 10:51 AM   #6
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 125Reputation: 125
I can imagine. I'm glad you got it narrowed down. Congratulations.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
environment variables slinky2004 Linux - General 4 11-26-2005 09:59 AM
retaining environment variables using ssh lightningdan Linux - Software 3 12-15-2004 05:43 PM
displaying variables in flash from php zowey Programming 0 10-04-2004 03:54 PM
when to use environment variables? mark_2811 Programming 2 02-23-2004 06:09 PM
Environment Variables if you su concoran Linux - Newbie 1 08-16-2002 07:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration