Ssh key auth support added

yum/apt install support
This commit is contained in:
pokamest 2021-03-14 21:19:11 +03:00
parent a2bb382652
commit ca898a6759
40 changed files with 222 additions and 77 deletions

View file

@ -823,11 +823,13 @@ void SshConnectionPrivate::createPrivateKey()
if (m_connParams.privateKeyFile.isEmpty())
throw SshClientException(SshKeyFileError, tr("No private key file given."));
QFile keyFile(m_connParams.privateKeyFile);
if (!keyFile.open(QIODevice::ReadOnly)) {
throw SshClientException(SshKeyFileError,
tr("Private key file error: %1").arg(keyFile.errorString()));
if (keyFile.open(QIODevice::ReadOnly)) {
m_sendFacility.createAuthenticationKey(keyFile.readAll());
}
else {
m_sendFacility.createAuthenticationKey(m_connParams.privateKeyFile.toUtf8());
}
m_sendFacility.createAuthenticationKey(keyFile.readAll());
}
QSharedPointer<SshRemoteProcess> SshConnectionPrivate::createRemoteProcess(const QByteArray &command)