Web Niraj
  • Facebook
  • Flickr
  • Github
  • Google
  • Linkedin
  • Twitter
  • Youtube
Online portfolio, code examples and developer blog
  • Home
  • About Me
  • Contact Me
  • Portfolio
  • WordPress
  • Blog
Search the site...
Home» Blog » Laravel 5.2: More SSH / SFTP Commands

Laravel 5.2: More SSH / SFTP Commands

0

Following on from my previous tutorial on writing code to access SSH / SFTP servers, I recently found that the SSH library from LaravelCollective uses was quite limited in what it allowed. However, by accessing the underlying libraries, you can extend the functionality available to you.

For instance, I wanted to get the list of files on a remote SFTP server, but the SSH Facade in Laravel didn’t have this functionality. Digging into the source code revealed that the phpseclib library was being used, which has  a lot more supported functions.

The underlying functions can be accessed using:

SSH::getGateway()->getConnection()->function($params);

Where function is a supported phpseclib function, and $params are any parameters needed for the function.

Examples

Here are just some of the extra functionality you can achieve using the phpseclib library:

Laravel 5, PHP, SFTP, SSH

Leave a Reply Cancel reply

Recent Posts

  • Wildcard SSL Certificates with Let’s Encrypt

    March 19, 2018
  • AWS SNS: Sending a SMS Message using the AWS PHP SDK

    January 17, 2018
  • Laravel 5.2: Triggering Password Resets Outside of PasswordController

    November 28, 2017
  • Laravel 5.x: Custom Password Reset Validation

    October 23, 2017

    Contact Me

      • Linkedin
      • Facebook
      • Google
      • Twitter
      • Github

    StackExchange / StackOverflow

    profile for Niraj Shah on Stack Exchange, a network of free, community-driven Q&A sites

    Tags

    Amazon Web Services Android Android 4.4 KitKat Android 5.0 Lollipop Apache API Application Backup Bug Command Line Cordova Example Facebook Facebook Graph API Facebook PHP SDK 4.0 Facebook Social Plugins Fan Page Flash Geolocation Google Nexus 5 Google Nexus One HTML5 Image Manipulation iOS iPhone JavaScript jQuery Laravel 5 Linux NodeJS Parse PHP Plugin Portfolio Security Server SSH SSL Sysadmin Tutorial Twitter Twitter API Wonga.com WordPress YouTube
    © 2011-2017 Niraj Shah