1834772 Members
2943 Online
110070 Solutions
New Discussion

login problem

 
navin
Super Advisor

login problem

Hi,
i have posted message regarding the ssh secure shell problem few days ago. Actually i'm having a problem that i'm able to execute ssh as a client from commnad line from a hp box.But ssh is failing with permission denied ,public key ,passwd error when used within the script. Any workaround idea or fix?Strongly Appreciated.
Thanks
Learning ...
3 REPLIES 3
Ivan Krastev
Honored Contributor

Re: login problem

Do you setup paswordless ssh login to be able to use it from script - http://www.cvrti.utah.edu/~dustman/no-more-pw-ssh/


regards,
ivan
navin
Super Advisor

Re: login problem

Thanks for the doc. But for couple of reasons i may wish to try the ssh with passwd.
Thanks anyway for the useful document.
Thanks
Learning ...
Tor-Arne Nostdal
Trusted Contributor

Re: login problem

There's not so many details in you problem description...

It could be a scripting error:
Do you try to pipe the password instead of sharing the public key?
- this will not work unless you're using a sophisticated script which send the password *after* you've received the prompt (otherwise the buffer will be cleared).
- it could be that you run with another username...
- always check environment when a script don't run properly as a cronjob.
- also make sure it is sh-posix or that you specify which kind of shell script

Assuming no script problem:
This could be a host lookup problem.
Quite common if you have multiple NIC's.

What is the hostname in the public key?
# cat ~/.ssh/id_rsa.pub

Is this the same user@hostname as you always will be resolved to on the remote host?

When you login and run the script manually, the script/communication is likely to use the same interface as you connected to.

Client -lan1-> Host:Script --ssh-lan1-> Host2
(no-pty)Host:Script --ssh-lan2-> Host2

If Host is resolved differently on Host2 depending on which interface it is using, it might be unable to verify the key.

/Tor-Arne
I'm trying to become President of the state I'm in...