telnet reading other user's login env - help

telnet reading other user's login env - help

Post by crs7 » Wed, 08 Aug 2001 01:19:18



I'm having a problem where telneting into one of our user machines
(Ultra 10) is sourcing some other environment variable data from other
than the login user's .profile.  I've checked the /etc/profile and
/etc/passwd to make sure everything looks okay.  I also truss'd the
inet.d process to see what was being executed on telnet login but that
appeared normal.

The other thing is that if I su as the login user (su - username), the
environment gets sourced correctly.  I'm thinking this is probably
something easy to fix but don't know the ins and outs of the detailed
login process.

The user's login shell is bash (.bashrc is okay).  Thanks for any
help.

--Chris

 
 
 

telnet reading other user's login env - help

Post by Alan Coopersmit » Wed, 08 Aug 2001 01:25:19



|I'm having a problem where telneting into one of our user machines
|(Ultra 10) is sourcing some other environment variable data from other
|than the login user's .profile.  I've checked the /etc/profile and
|/etc/passwd to make sure everything looks okay.  I also truss'd the
|inet.d process to see what was being executed on telnet login but that
|appeared normal.

I had this happen once - did someone su to root and then start inetd?
If so, inetd captured their $USER variable and is passing it on to
everyone else.  If this is the problem, the fix is easy:
        su -
        pkill inetd
        /usr/sbin/inetd -s

(or just reboot) and then make sure the person who restarted it knows
they should almost never need to do that on Solaris - kill -HUP will
make it re-read the inetd.conf file.

--
________________________________________________________________________


  Working for, but definitely not speaking for, Sun Microsystems, Inc.

 
 
 

telnet reading other user's login env - help

Post by Darren Dunha » Wed, 08 Aug 2001 05:27:40




> |I'm having a problem where telneting into one of our user machines
> |(Ultra 10) is sourcing some other environment variable data from other
> |than the login user's .profile.

It is almost certainly using an existing environment (that of inetd)
rather than sourcing a file.

Quote:> |I've checked the /etc/profile and /etc/passwd to make sure everything
> |looks okay.  I also truss'd the inet.d process to see what was being
> |executed on telnet login but that appeared normal.

Find the PID of inetd and do...
/usr/ucb/ps eww <PID>

If you have a USER variable defined, that's bad.

Quote:> I had this happen once - did someone su to root and then start inetd?
> If so, inetd captured their $USER variable and is passing it on to
> everyone else.  If this is the problem, the fix is easy:
>    su -
>    pkill inetd
>    /usr/sbin/inetd -s

Nope.  You'll change the USER, but it will still exist...

Quote:> (or just reboot) and then make sure the person who restarted it knows
> they should almost never need to do that on Solaris - kill -HUP will
> make it re-read the inetd.conf file.

Great advice.  Don't kill inetd unless extremely necessary.  

To fix without rebooting though, start it like this...

/usr/bin/env -i PATH=/usr/sbin:/usr/bin TZ=US/Pacific /usr/sbin/inetd -s

Replace TZ with your proper timezone, obviously.

> --
> ________________________________________________________________________


>   Working for, but definitely not speaking for, Sun Microsystems, Inc.

--

Unix System Administrator                    Taos - The SysAdmin Company
Got some Dr Pepper?                           San Francisco, CA bay area
          < How are you gentlemen!! Take off every '.SIG'!! >
 
 
 

telnet reading other user's login env - help

Post by Mathew Kirsc » Wed, 08 Aug 2001 23:34:12



> I'm having a problem where telneting into one of our user machines
> (Ultra 10) is sourcing some other environment variable data from other
> than the login user's .profile.  I've checked the /etc/profile and
> /etc/passwd to make sure everything looks okay.  I also truss'd the
> inet.d process to see what was being executed on telnet login but that
> appeared normal.

What makes you think this? What are the symptoms? We can't help you if all you
say is "it don't work right."

Has someone killed and restarted inetd manually? That's a BAD THING(tm) to do,
because inetd then takes on root's environment at the time, and passes it on
to every user login and other process. When you need to re-read
/etc/inetd.conf, please use "kill -HUP" instead.

Rebooting will solve the problem, as will killing and restarting inetd without
an environment.