Jump to content

SSH2 Auth Pubkey assistance


jamgam

Recommended Posts

I've got a little php script here at work that used to log into a SSH server and grab some log files and show them in a web browser.  Simple stuff.  Recently we've changed the login on the servers to use our VPN tokens instead of a password that I pick for my account.  We can use authorized keys which works fine for me in putty and I'm trying to set that up because I keep getting prompted for user and password the "old" way.

 

I'm using ssh2_auth_pubkey_file and been reading the manual about it but I can't seem to get it to work

 

I make my connection as follows

 

 

$connection = ssh2_connect($serverHost, 22, array('hostkey'=>'ssh-rsa'));

 

Then setup the auth_pubkey.  There is no passphrase or anything I use with putty so i left that part out

 

 

$result = ssh2_auth_pubkey_file($connection, 'username','/path/to/id_rsa.pub','/path/to/id_rsa');

 

the information in my id_rsa.pub file matches what's in authorized_keys on the server in my username/.ssh dir

 

I'm not 100% what else to check for?  Anyone have any tips

Thanks

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.