[Hampshire] irritating ssh behaviour

Top Page

Reply to this message
Author: Victor Churchill
Date:  
To: Hampshire LUG Discussion List
Subject: [Hampshire] irritating ssh behaviour
I have an Oracle server which I can access with a passwordless ssh
login from my desktop, connecting as the 'oracle' user.
In ~/.ssh/config, I have:
Host qq3
User oracle
, and the appropriate setup of id_dsa.pub, authorized_keys2 etc.

I do not have an Oracle installation on the desktop machine itself.

Running an application that uses the Ora server, I see an Oracle error
reported: (ORA-24315: illegal attribute type.)

I'd like to see what Oracle has to say about this. I *can* do this:

victor@ss07:~$ ssh qq3
Last login: Thu Nov 27 09:31:26 2008 from obscure.sotn.cable.ntl.com
[oracle@db 12:46 ~]$ oerr ORA 24315
24315, 00000, "illegal attribute type"
// *Cause: An illegal attribute type was specified for the handle.
// *Action: Consult user manual to specify an attribute valid for this handle.
[oracle@db 12:46 ~]$ logout

Connection to qq3 closed.

However, that means I have to remember to log out of the server so I'd
rather just run the oerr command as an argument to the ssh command.
Unfortunately,

victor@ss07:~$ ssh qq3 "oerr ORA 12152"
bash: line 1: oerr: command not found

victor@ss07:~$ ssh qq3 'oerr ORA 12152'
bash: line 1: oerr: command not found

Apparently either *my* bash is saying "I know no oerr" so it is not
forwarding the command to the remote server, or the oracle user's
environment is not getting set up for the execution of the command.

My local path:
victor@ss07:~$ echo $PATH
/home/victor/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

oracle's path , and access to oerr command, on remote machine:
victor@ss07:~$ ssh qq3
[oracle@db 13:34 ~]$ echo $PATH
/u01/app/oracle/OraHome_1/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/oracle/bin

[oracle@db 13:36 ~]$ which oerr
/u01/app/oracle/OraHome_1/bin/oerr
[oracle@db 13:36 ~]$

ssh-ing in as a different user seems to have odd effects on the environment:
victor@ss07:~$ ssh qq3 "which oerr"
which: no oerr in (/usr/local/bin:/bin:/usr/bin)

victor@ss07:~$ ssh qq3 'echo $PATH'
/usr/local/bin:/bin:/usr/bin

But simple commands are as you would expect:
victor@ss07:~$ ssh qq3 whoami
oracle

victor@ss07:~$ ssh qq3 pwd
/home/oracle

[oracle@db 13:49 ~]$ cat > ~/bin/hello
#!/bin/bash
echo Hello
[oracle@db 13:50 ~]$ chmod +x !$
chmod +x ~/bin/hello
[oracle@db 13:50 ~]$ hello
Hello


victor@ss07:~$ ssh qq3 hello
bash: line 1: hello: command not found
victor@ss07:~$


The ssh man page sayeth:
SYNOPSIS
     ssh <lots of options> [user@]hostname [command]
...
     If command is specified, it is executed on the remote host
instead of a login shell.


Something's not right...