Operating System - Linux
1827704 Members
2870 Online
109967 Solutions
New Discussion

Unexpected messages when using ssh and rlogin

 
Tony Rossomano_2
Occasional Contributor

Unexpected messages when using ssh and rlogin

Hello, I'm getting some strange messages when using ssh and rlogin to remote login into our server. We have a simple network setup right now, with a Compaq Proliant Server running RedHat Advanced Server 2.1 and a few Compaq workstations running RedHat 8.0. We are using NIS to share user and host name information with the workstations(the only user created on the workstations is root, all other users are created on the server). When we use rlogin or ssh to remote login into the server(using a user other than root), we get these messages:

root: command not found
root: Undefined variable

The remote login works fine, but we have these messages.
I also have a question about user environments. When we remote login via ssh or rlogin does the user's environment get setup? i.e. does the .cshrc get executed? For example, our users use the c-shell. So, when we remote login, should we have history and all the other common features of the shell environment? Oh, and could those messages have anything to do with the fact that rlogin and ssh are suid root?
Any help would be greatly appreciated. I would really like to get rid of those messages!!

Thanks,

Tony
5 REPLIES 5
Michael Armbrecht
Frequent Advisor

Re: Unexpected messages when using ssh and rlogin

Which command line do you use exactly to connect to the server?

What does ssh_config look like on your server?
Never be afraid to try something new. Remember, amateurs built the ark. Professionals built the Titanic.
V.Tamilvanan
Honored Contributor

Re: Unexpected messages when using ssh and rlogin

Steven E. Protter
Exalted Contributor

Re: Unexpected messages when using ssh and rlogin

This has nothing to do with NIS.

It has to do with environments and how rlogin and ssh work.

When you rlogin or ssh to another server, even if you have exchanged public keys you don't get an environment on the target server.

That environment must be set in the script you are running, which must be referred to by its full path name.

ssh server1 "cp /etc/issue /tmp/issue"

probably won't work, because you have no PATH variable and this command doesn't know where to look for the cp command.

Your script needs to define everything, every environment variable, including TERM if needed to properly run the program on the remote server. PATH is most important. If you set that up and run subsequent scripts you will then have an environment if the variables are exported.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Caesar_3
Esteemed Contributor

Re: Unexpected messages when using ssh and rlogin

Hello!

Check your enviroment sources, you may found
something also check that every shell run
also default enviroment sources that
sit in /etc

Caesar
Bill Douglass
Esteemed Contributor

Re: Unexpected messages when using ssh and rlogin

Steven, I think you may be mistaken on the environment issue. I tried the following:

ganesha:/home/bdouglas> ssh qe2l1 env
SHELL=/usr/local/bin/bash
SSH_CLIENT=10.241.16.48 35329 22
USER=bdouglas
SSH_AUTH_SOCK=/tmp/ssh-Bbu25927/agent.25927
MAIL=/var/spool/mail/bdouglas
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
PWD=/home/bdouglas
TZ=CST6CDT
SHLVL=1
HOME=/home/bdouglas
LOGNAME=bdouglas
DISPLAY=localhost:11.0
_=/usr/bin/env


Any commands executed by ssh are run after the environment is set up, including the path.

Mind you, it is good advice to always specify full path names in a script, especially when multiple users may be using a script.