protected function getOptions(InputInterface $input)
    {
        $opts = array();

        foreach ($this->sshOptionOptions as $key => $option) {
            if ($input->getOption($key)) {
                $opts[$option] = $input->getOption($key);
            }
        }

        if ($input->getOption('keyfile')) {
            $opts['PasswordAuthentication'] = 'no';
            $opts['PubkeyAuthentication'] = 'yes';
            $opts['IdentitiesOnly'] = 'yes';
            $opts['IdentityFile'] = $input->getOption('keyfile');
        } else if ($input->getOption('password')) {
            $opts['PasswordAuthentication'] = 'yes';
            $opts['PubkeyAuthentication'] = 'no';
        }

        return $opts;
    }