Can not login to remote SSH server using ssh2_auth_pubkey_file
3 Message(s) by 2 Author(s) originally posted in php programming
| From: Royan |
Date: Friday, October 26, 2007
|
I'm trying to make use of ssh2_auth_pubkey_
file () and login into
remote
machine .
I have read somewhere that in order to make that
function work I have to
supply it with public
key with specific format due to limitation of
libssh2. The public key should look like this:
<key_type >{1 space
character}
<key_data>
Well it still doesn't work even if I change my public key file. Says
"Authentication failed for
<user_name> using public key" Can somebody
help me and perhaps give an idea where to look next?Yes, unfortunately I can not use any other way of logging in to the
remote PC, so username/password isn't an
option for me
| From: Jeremy |
Date: Friday, October 26, 2007
|
wrote in message:
I'm trying to make use of ssh2_auth_pubkey_file() and login into
remote machine.
I have read somewhere that in order to make that function work I have to
supply it with public key with specific format due to limitation of
libssh2. The public key should look like this: <key_type>{1 space
character}<key_data>
Well it still doesn't work even if I change my public key file. Says
"Authentication failed for <user_name> using public key" Can somebody
help me and perhaps give an idea where to look next?
Yes, unfortunately I can not use any other way of logging in to the
remote PC, so username/password isn't an option for me
Are you sure you've all the pieces in place for this? For it to work,
you must:
1) Have the public key installed on the remote
server in the user's
authorized_keys file. The file (and sometimes the whole directory) must
have appropriate permissions (typically 600) or the server may ignore it.
2) Have both the private and public keys on the local machine (I'm not
sure why they require the pubkey, but they do). If the private key is
encrypted, you must also pass the
passphrase to ssh2_auth_pubkey_file.
I have done this successfully without monkeying with the key files, so I
doubt that is your issue. Did you use OpenSSH to
generate the keys? If
not, they could be in the wrong format - but you almost certainly did
use OpenSSH so the keys should be OK. I'm betting it's a problem on the
remote server (permissions) or the private key being encrypted.
Jeremy
| From: Royan |
Date: Saturday, October 27, 2007
|
wrote in message:
wrote in message:
> I'm trying to make use of ssh2_auth_pubkey_file() and login into
> remote machine.
> I have read somewhere that in order to make that function work I have to
> supply it with public key with specific format due to limitation of
> libssh2. The public key should look like this: <key_type>{1 space
> character}<key_data>
> Well it still doesn't work even if I change my public key file. Says
> "Authentication failed for <user_name> using public key" Can somebody
> help me and perhaps give an idea where to look next?
> Yes, unfortunately I can not use any other way of logging in to the
> remote PC, so username/password isn't an option for me
Are you sure you've all the pieces in place for this? For it to work,
you must:
1) Have the public key installed on the remote server in the user's
authorized_keys file. The file (and sometimes the whole directory) must
have appropriate permissions (typically 600) or the server may ignore it.
2) Have both the private and public keys on the local machine (I'm not
sure why they require the pubkey, but they do). If the private key is
encrypted, you must also pass the passphrase to ssh2_auth_pubkey_file.
I have done this successfully without monkeying with the key files, so I
doubt that is your issue. Did you use OpenSSH to generate the keys? If
not, they could be in the wrong format - but you almost certainly did
use OpenSSH so the keys should be OK. I'm betting it's a problem on the
remote server (permissions) or the private key being encrypted.
Jeremy
Well the thing is that I have used that private key to generate my
public key (did that using PuTTYgen) I don't mention that I have added
public key to "authorized_keys" file and now I successfully login to
the remote server (using PuTTY) with this particular public key that I
use in my php script. So I assume this isn't a problem of incorrect
permissions. Perhaps it happens because I use ssh-dss key type instead
of ssh-rsa key?
Next Message: Best solution to tedious form validation?
Blogs related to Can not login to remote SSH server using ssh2_auth_pubkey_file
Magazine publishing independent motor news and reviews.
923 048 3333 wearing a condom tottenville high school staten island.
can not archive money 2007 audi islip akona kevlar gloves cost of admission tour eiffel gadow guitars dmd christine e. chioffi fungi is a family of julie boele
...
Mote
... motel, florida,leland super 8 motel and bloomington, minnesota motel vicini a milano slingplayer
cannot control home tv with remote control how to make a remote control car14186040401087426405 lutron remote control dimmer kahuko
...