Operating System - HP-UX
1752730 Members
5553 Online
108789 Solutions
New Discussion юеВ

Re: Exec format error using ssh

 
arupdas
Occasional Advisor

Exec format error using ssh

hi,

I have RP3440 server running HP UNIX version 11i-v1. When i am trying to login as a local ssh user got some error message
"Last login: Sat Jun 6 13:02:04 2009 from 10.239.254.42
/anapdata1/doel/POLICE/delhi/test: Exec format error"
and unable to log the system. But using telnet with same user no problem found to login and perform my job.

Password file entry :

del_cdr:46pR.CFBR7eD.:136:20:,,,:/anapdata1/doel/POLICE/delhi:/anapdata1/doel/POLICE/delhi/test

Wait for response.
10 REPLIES 10
Dennis Handly
Acclaimed Contributor

Re: Exec format error using ssh

>"Exec format error" and unable to log the system. But using telnet with same user no problem found to login and perform my job.

That's strange. What does that executable do?
And you said when you use telnet it immediately executes that program?

Possibly ssh is changing SHLIB_PATH and pointing to the wrong version of some shlib?
What does this show:
file /anapdata1/doel/POLICE/delhi/test
arupdas
Occasional Advisor

Re: Exec format error using ssh

Inside 'test' file there is one .sh file which i attached .
When we login using ID that script is running and execute.
Dennis Handly
Acclaimed Contributor

Re: Exec format error using ssh

Your script should start with:
#!/usr/bin/sh

If that doesn't fix it, you can add a "-x" to trace the commands.
arupdas
Occasional Advisor

Re: Exec format error using ssh

We don't start script manually. Using telnet when we login the server, script start automatically because of login shell is metioned "anapdata1/doel/POLICE/delhi/test".


And using ssh login we are unable to login and so script is also not running.

Wiating for hands.
Dennis Handly
Acclaimed Contributor

Re: Exec format error using ssh

>We don't start script manually.

That was obvious. Have you added that #! yet?
Armin Kunaschik
Esteemed Contributor

Re: Exec format error using ssh

ssh with an command does not start a login shell!!! That means the environment is set only to default values.
That means that your program is responsible to create the necessary environment.
Try sourcing /etc/profile and your .profile (including all SAP profiles) before doing anything else!

My 2 cents,
Armin

And now for something completely different...
Dennis Handly
Acclaimed Contributor

Re: Exec format error using ssh

>Armin: ssh with a command does not start a login shell

Why are you mentioning some true but useless info?

In this case, the user's script IS the login shell. Which means that neither /etc/profile nor ~/.profile will be executed. This echoes the last part of your statement. This is probably not important since it works with telnet. Though I suppose they could have different $PATH settings.
Armin Kunaschik
Esteemed Contributor

Re: Exec format error using ssh

Ooops. You're right. My fault. But I guess, it could be useful to check the environment! ssh might change/reset some environment variables for security reason, thus preventing the right environment.
Another thing to try: put the script name (including path) into /etc/shells.

Another 2 cents,
Armin
And now for something completely different...
Bill Hassell
Honored Contributor

Re: Exec format error using ssh

And just a warning about scripts named: test
This is the name of a shell command and you can create very confusing error messages when the shell picks the wrong thing to run. At least call the script: test1


Bill Hassell, sysadmin