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

Laravel 5.2: More SSH / SFTP Commands

1

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

One comment on “Laravel 5.2: More SSH / SFTP Commands”

  1. Joseph H. says:
    December 5, 2020 at 12:29 AM

    Thank you very much! Very usefull

    Reply

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

StackExchange / StackOverflow

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

Support Me

Buy Me a Coffee

PSN Profile

Tags

ACL Amazon Web Services Android Android 4.4 KitKat Android 5.0 Lollipop Apache Backup Bash Bug Command Line Cordova cPanel / WHM Facebook Facebook Graph API Facebook PHP SDK 4.0 Facebook Social Plugins Fan Page Flash Geolocation Google Nexus 5 Hacking HTML5 Input Sanitization iOS JavaScript jQuery Laravel 5 Laravel 5.2 Linux Mac OS NodeJS Parse PDF PHP Plugin Portfolio Review Security Server SSH SSL Sysadmin Tutorial WordPress WordPress Plugins
© 2011-2025 Niraj Shah
  • Blog
  • Portfolio
  • WordPress
  • About Me
  • Contact Me
  • Privacy Policy
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Privacy Policy