Results 1 to 7 of 7

Thread: Safe mode hack with SFTP

  1. #1
    User
    Join Date
    08-09-09.
    Location
    Zwolle, The Netherlands
    Posts
    73

    Default Safe mode hack with SFTP

    Hello,

    I'm trying to use the safe mode hack on a SFTP server, however, I'm unable to get it to work.
    I have checked the credentials (they look correct) and tried it with and without checking "Connect via FTP-SSL", but no luck.

    Can anybody help?

  2. #2
    Community-Moderator xchs's Avatar
    Join Date
    06-19-09.
    Posts
    1,287

    Default Re: Safe mode hack with SFTP

    Please note: SFTP (SSH File Transfer Protocol) != FTPS (FTP over SSL/TLS)
    Contao Community Moderator
    → Support options

  3. #3
    User
    Join Date
    08-09-09.
    Location
    Zwolle, The Netherlands
    Posts
    73

    Default Re: Safe mode hack with SFTP

    Thanks. I definitely need SFTP and not FTPS.

    There seems to an extended version of the Safe Mode Hack (an extension of Contao), and I did install it, but I can't get that to work either:
    http://www.contao.org/erweiterungsliste ... l#new-name

    Here is a (German) forum post about this topic: http://www.contao-community.de/showthre ... s-probleme

  4. #4
    User
    Join Date
    08-09-09.
    Location
    Zwolle, The Netherlands
    Posts
    73

    Default Re: Safe mode hack with SFTP

    I used the extended SMH extension from Contao, with the following code in my localconfig.php:
    Code:
    $GLOBALS['TL_CONFIG']['useSmhExtended'] = true; // dies aktiviert den erweiterten SMH.
    $GLOBALS['TL_CONFIG']['useSMHClass'] = 'SMHSFTP'; // Bitte lassen Sie diese Option unveraendert, bislang gibt es nur das SFTP Protokoll.
    $GLOBALS['TL_CONFIG']['ftpHost'] = 'ftp.domain.nl';
    $GLOBALS['TL_CONFIG']['ftpPath'] = '/domains/my_domain/DEFAULT/';
    $GLOBALS['TL_CONFIG']['ftpUser'] = 'login_name';
    $GLOBALS['TL_CONFIG']['ftpPass'] = 'password******';
    $GLOBALS['TL_CONFIG']['ftpPort'] = 22;
    When I run the install tool, I get the following error:

    Warning: get_class() expects parameter 1 to be object, string given in /domains/my_domain/DEFAULT/plugins/phpseclib/Net/SSH2.php on line 1276
    #0 [internal function]: __error(2, 'get_class() exp...', '/domains/my_domain...', 1276, Array)
    #1 /domains/my_domain/DEFAULT/plugins/phpseclib/Net/SSH2.php(1276): get_class('password******')
    #2 /domains/my_domain/DEFAULT/plugins/phpseclib/Net/SFTP.php(316): Net_SSH2->login('login_name...', 'password******')
    #3 /domains/my_domain/DEFAULT/system/libraries/SMHSFTP.php(71): Net_SFTP->login('login_name...', 'password******')
    #4 /domains/my_domain/DEFAULT/system/libraries/SMHExtended.php(41): SMHSFTP->connect()
    #5 /domains/my_domain/DEFAULT/system/libraries/SMHExtended.php(58): SMHExtended->connect()
    #6 /domains/my_domain/DEFAULT/system/libraries/Files.php(79): SMHExtended->__construct()
    #7 [internal function]: Files::getInstance()
    #8 /domains/my_domain/DEFAULT/system/libraries/System.php(147): call_user_func(Array)
    #9 /domains/my_domain/DEFAULT/contao/install.php(171): System->import('Files')
    #10 /domains/my_domain/DEFAULT/contao/install.php(1211): InstallTool->run()
    #11 {main}

    Notice: Expected SSH_FXP_VERSION in /domains/my_domain/DEFAULT/plugins/phpseclib/Net/SFTP.php on line 355
    #0 [internal function]: __error(1024, 'Expected SSH_FX...', '/domains/my_domain...', 355, Array)
    #1 /domains/my_domain/DEFAULT/plugins/phpseclib/Net/SFTP.php(355): user_error('Expected SSH_FX...', 1024)
    #2 /domains/my_domain/DEFAULT/system/libraries/SMHSFTP.php(71): Net_SFTP->login('login_name...', 'password******')
    #3 /domains/my_domain/DEFAULT/system/libraries/SMHExtended.php(41): SMHSFTP->connect()
    #4 /domains/my_domain/DEFAULT/system/libraries/SMHExtended.php(58): SMHExtended->connect()
    #5 /domains/my_domain/DEFAULT/system/libraries/Files.php(79): SMHExtended->__construct()
    #6 [internal function]: Files::getInstance()
    #7 /domains/my_domain/DEFAULT/system/libraries/System.php(147): call_user_func(Array)
    #8 /domains/my_domain/DEFAULT/contao/install.php(171): System->import('Files')
    #9 /domains/my_domain/DEFAULT/contao/install.php(1211): InstallTool->run()
    #10 {main}

    Fatal error: Uncaught exception Exception with message Could not login to sftp: thrown in /domains/my_domain/DEFAULT/system/libraries/SMHSFTP.php on line 73
    #0 /domains/my_domain/DEFAULT/system/libraries/SMHExtended.php(41): SMHSFTP->connect()
    #1 /domains/my_domain/DEFAULT/system/libraries/SMHExtended.php(58): SMHExtended->connect()
    #2 /domains/my_domain/DEFAULT/system/libraries/Files.php(79): SMHExtended->__construct()
    #3 [internal function]: Files::getInstance()
    #4 /domains/my_domain/DEFAULT/system/libraries/System.php(147): call_user_func(Array)
    #5 /domains/my_domain/DEFAULT/contao/install.php(171): System->import('Files')
    #6 /domains/my_domain/DEFAULT/contao/install.php(1211): InstallTool->run()
    #7 {main}
    I'm sort of at a loss here. Does anybody have any ideas? I use the same credentials to login to the SFTP in the localconfig.php as I do with FileZilla, so that should work.

  5. #5
    Experienced user
    Join Date
    08-21-09.
    Posts
    563

    Default Re: Safe mode hack with SFTP

    Hi Cothedo,

    One thing I noticed -- smhextended only "officially" works with 2.8. Could it maybe be a compatibility issue?
    Brian

  6. #6
    User
    Join Date
    08-09-09.
    Location
    Zwolle, The Netherlands
    Posts
    73

    Default Re: Safe mode hack with SFTP

    Quote Originally Posted by Medianomaly
    Hi Cothedo,

    One thing I noticed -- smhextended only "officially" works with 2.8. Could it maybe be a compatibility issue?

    Yes, it could be a compatibility issue, however, I have no idea how to fix that. I'm not an experienced programmer.

  7. #7
    User
    Join Date
    08-09-09.
    Location
    Zwolle, The Netherlands
    Posts
    73

    Default Re: Safe mode hack with SFTP

    It's solved now: I managed it by switching to regular FTP instead SFTP.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •