Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Linux and Unix Linux and Unix
Search Search
Search for:
Tech Support Guy > > >

SSH command


(!)

Boylett's Avatar
Boylett Boylett is offline
Computer Specs
Member with 55 posts.
THREAD STARTER
 
Join Date: Dec 2006
Experience: Intermediate
26-Aug-2009, 09:23 AM #1
SSH command
Hi

I'm trying to run the SSH command from PHP to be able to execute ssh commands on remote servers. I have tried this (ran from PHP/apache):

ssh -v -l user -o stricthostkeychecking=no host.tld

which works from command line, but not from PHP.

Here's the output when its PHP:

Code:
OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to --- [---] port 22.
debug1: Connection established.
debug1: identity file /var/www/.ssh/identity type -1
debug1: identity file /var/www/.ssh/id_rsa type -1
debug1: identity file /var/www/.ssh/id_dsa type -1
debug1: loaded 3 keys
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3
debug1: match: OpenSSH_4.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.3
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host '---' is known and matches the RSA host key.
debug1: Found key in /var/www/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure.  Minor code may provide more information
No credentials cache found

debug1: Unspecified GSS failure.  Minor code may provide more information
No credentials cache found

debug1: Unspecified GSS failure.  Minor code may provide more information
No credentials cache found

debug1: Next authentication method: publickey
debug1: Trying private key: /var/www/.ssh/identity
debug1: Trying private key: /var/www/.ssh/id_rsa
debug1: Trying private key: /var/www/.ssh/id_dsa
debug1: Next authentication method: password
debug1: read_passphrase: can't open /dev/tty: No such device or address
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
Permission denied, please try again.
debug1: read_passphrase: can't open /dev/tty: No such device or address
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
Permission denied, please try again.
debug1: read_passphrase: can't open /dev/tty: No such device or address
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: No more authentication methods to try.
Permission denied (publickey,gssapi-with-mic,password).
How can I get it to work?
Thanks.
lotuseclat79's Avatar
Member with 20,583 posts.
 
Join Date: Sep 2003
Location: -71.45091, 42.27841
26-Aug-2009, 02:05 PM #2
Hi Boylett,

Obviously, there is an authentication problem when PHP is used rather than the command line. Check out OpenSSH and GSSAPI Mechglue to determine whether you have the patch they talk about in your software.

Also, check out Perl GSSAPI Bindings to see if you are missing some/all/any.

Also, does the Apache user have the correct permissions to write to the kerberos cache?

The problem may be an imap server problem rather than php.

Read this web page: Bug #33500 imap_open() fails when the server advertises GSSAPI.

Make sure all of your software is up-to-date. Also. why not try this post in the Web Design and Development subforum where they may have more expertise in PHP problem solutions.

Are you using any Linux distribution - i.e. your computer spec say Windows?

-- Tom
__________________
The independence created by philosophical insight is - in my opinion - the mark of distinction
between a mere artisan or specialist and a real seeker after truth. - Einstein 1944
Imagination is more important than knowledge. - Einstein
Boylett's Avatar
Boylett Boylett is offline
Computer Specs
Member with 55 posts.
THREAD STARTER
 
Join Date: Dec 2006
Experience: Intermediate
26-Aug-2009, 05:09 PM #3
Thanks for your reply

The OS is Linux CentOS 5. I will try those links you gave
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


Tags
ssh command php

(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑

Content Relevant URLs by vBSEO 3.3.2