Tuesday, March 14, 2017

Laravel 5.1 SSH - Unable to connect to remote server

I followed everything in this link here :

Laravel 5.1 SSH

https://laravelcollective.com/docs/5.1/ssh

Note:

  • Key is the key that I usally use to SSH into my VM.
  • Passphrase also entered correctly.
  • Local Env = Mac OS X
  • username = bheng
  • private key has set to 0600
  • -rw------- 1 bheng staff 1766 Mar 10 13:25 id_rsa
  • public key has set to 0600
  • -rw------- 1 bheng staff 1766 Mar 10 13:25 id_rsa.pub

config

'connections' => [
    'production' => [
        'host'      => '45.55.88.88',
        'username'  => 'root',
        'password'  => '',
        'key'       => '../id_rsa',
        'keytext'   => '',
        'keyphrase' => '*****',
        'agent'     => '',
        'timeout'   => 10,
    ],
],


I've tried a few more options :

1. Place private key in same directory as the settings file

'key'       => 'id_rsa',

2. Place public key in same directory as the settings file

'key'       => 'id_rsa.pub',

3. Full path to private key

'key'       => '/Users/bheng/.ssh/id_rsa',

4. Full path to public key

'key'       => '/Users/bheng/.ssh/id_rsa.pub',


Usage

I tried run a simple date command.

SSH::into('production')->run(['date']);


Result

I kept getting

Unable to connect to remote server


Questions

Did I forget anything ? Is my configuration looks okay ?

How would one go about this continue debuging this ?



via ihue

Advertisement