(Unix) Login with ssh ... TERM not set.

From: Ronald Fischer (ronaldf_at_eml.cc)
Date: 08/05/03


Date: 5 Aug 2003 02:20:29 -0700

The account on the target machine I ssh into has sh as a default shell. Since
I prefer bash, but don't want to manually invoke 'bash' every time I log in,
I tried the following comand:

  ssh HOST -l USERID /usr/local/bin/bash --rcfile MYBASHRC -i

This does nearly what I want, but I get the error messages

  bash: no job control in this shell
  stty: : Not a typewriter

The stty message is caused by the execution of MYBASHRC, which contains the
command

  stty erase ^H

It seems that both messages have the same cause, i.e. that bash does not
believe that it is invoked by a terminal. Indeed, the TERM variable is set
to "dumb".

When I login the "conservative" way, i.e.

  ssh HOST -l USERID

and then invoke bash manually, everything works in the normal way and the
TERM variable is set to TERM. I guess that since ssh just thinks it should
remotely execute some command, it does not know that I am going to use
an interactive shell, and therefore does not care to set TERM for me.

Is there a way to tell ssh to execute my remote command "like a shell"?
I checked the man-pages, but did not find a suitable command line switch.

Ronald



Relevant Pages

  • Setting environment variables...
    ... When I invoke the terminal application I believe the shell is Bash, ... not sure if thats relavant to my application though. ...
    (comp.sys.mac.system)
  • Re: ssh + bash
    ... > I have a very simple question about ssh. ... > bash as my shell. ... When I log in to my account using ssh ...
    (comp.security.ssh)
  • Re: Setting environment variables...
    ... When I invoke the terminal application I believe the shell is Bash, ... not sure if thats relavant to my application though. ...
    (comp.sys.mac.system)
  • Re: .bashrc not executed
    ... > On all my accounts, I have bash as my shell. ... When I use ssh ... but why bother since "man bash" has the explanation. ...
    (comp.security.ssh)
  • Re: Another variant of "ssh" working interactively, but "ssh cmd" and "scp" failing
    ... I've read the SSH and OpenSSH FAQ, ... PowerPC, the shell is a busybox, but using bash does not change ... ssh root@FOO ls -- fails, no output, no matter what command is given ...
    (comp.security.ssh)