How can we install/update to the WordPress plugins without providing FTP access?

How can we install/update to the WordPress plugins without providing FTP access?

Asked on October 24, 2018 in Wordpress.
Add Comment


  • 4 Answer(s)

    We can characterize a constant, ‘FS_METHOD’ in our wp-config.php document, that is either ‘coordinate’,ssh‘, ‘ftpext‘ or ‘ftpsockets‘ and it will utilize that strategy.

        Remember that on the off chance that you set this to ‘coordinate’, however our web client (the username under which our web server runs) does not have legitimate compose consents, you will get a blunder.

        In rundown, in the event that we would prefer not to (or you can’t) change consents on wp-content so our web server has compose authorizations, at that point add this to our wp-config.php document:

    define('FS_METHOD', 'coordinate');
    
    Answered on October 24, 2018.
    Add Comment

    We need to change the perms accordingly AND put the following in our wp-config.php:

    define('FS_METHOD', 'direct');
    
    Answered on October 24, 2018.
    Add Comment

    1) We set the responsibility for wordpress envelope (recursively) to the apache client , similar to so:

    # chown - R apache wordpress/
    

    2) We changed the gathering responsibility for wordpress envelope (recursively) to the apache gathering, similar to so:

    # chgrp - R apache wordpress/
    

    3) Give proprietor full benefit to the registry, similar to so:

    # chmod u+wrx wordpress/*
    

    Further more, that did the activity. My wp-content organizer has 755 authorizations,

    TL;DR variant:

    # chown - R apache:apache wordpress
    # chmod u+wrx wordpress/*
    

     

    Answered on October 24, 2018.
    Add Comment

    In order to enable the use of SSH2 for your updates and theme uploads, you have to generate your SSH keys and have the PHP SSH module installed. Then WordPress will detect that you have SSH2 available and you’ll see a different option (SSH2) displayed when doing an upload/upgrade.

    1.) Make sure you have the PHP module installed for debian it is:

    sudo apt-get install libssh2-php

    2.) Generate SSH keys, adding a passphrase is optional:

    ssh-keygen
    cd  ~/.ssh
    cp id_rsa.pub authorized_keys

    3.) Change the permission so that WordPress can access those keys:

    cd ~
    chmod 755 .ssh
    chmod 644 .ssh/*

    Now you’ll get the SSH2 option when doing an upload/upgrade/plugin. WP SSH Connection

    4.) For added ease you can setup the defaults in your wp-config.phpand this will pre-populate the SSH credentials in the WordPress upload window.

    define('FTP_PUBKEY','/home/<user>/.ssh/id_rsa.pub');
    define('FTP_PRIKEY','/home/<user>/.ssh/id_rsa');
    define('FTP_USER','<user>');
    define('FTP_PASS','passphrase');
    define('FTP_HOST','domain.com');

    The ‘passphrase’ is optional, if you don’t setup a passphrase during ssh-kengen; then don’t add it in wp-config.php

    This solved my issue. And I didn’t have to do the chown at all. But I have seen this method referenced in other places

    Answered on February 20, 2019.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.