chmod(rPath, mode, addListeners = true) {
    let listeners;
    return new Promise((resolve, reject) => {
      if (addListeners) {
        listeners = addTempListeners(this, 'chmod', reject);
      }
      if (haveConnection(this, 'chmod', reject)) {
        this.sftp.chmod(rPath, mode, (err) => {
          if (err) {
            reject(this.fmtError(`${err.message} ${rPath}`, '_chmod', err.code));
          }
          resolve('Successfully change file mode');
        });
      }
    }).finally(() => {
      if (addListeners) {
        removeTempListeners(this, listeners, 'chmod');
      }
    });
  }
@async

Change the mode of a remote file on the SFTP repository

@param {string} remotePath - path to the remote target object.
@param {number | string} mode - the new octal mode to set
@param {boolean} addListeners - (Optional) if true, add listeners. Default true.

@return {Promise<String>}