ssh2_auth_hostbased_file

(PECL ssh2 >= 0.9.0)

ssh2_auth_hostbased_fileAuthenticate using a public hostkey

Beschreibung

ssh2_auth_hostbased_file(
    resource $session,
    string $username,
    string $hostname,
    string $pubkeyfile,
    string $privkeyfile,
    string $passphrase = ?,
    string $local_username = ?
): bool

Authenticate using a public hostkey read from a file.

Parameter-Liste

session

An SSH connection link identifier, obtained from a call to ssh2_connect().

username

hostname

pubkeyfile

privkeyfile

passphrase

If privkeyfile is encrypted (which it should be), the passphrase must be provided.

local_username

If local_username is omitted, then the value for username will be used for it.

Rückgabewerte

Gibt bei Erfolg true zurück. Bei einem Fehler wird false zurückgegeben.

Beispiele

Beispiel #1 Authentication using a public hostkey

<?php
$connection 
ssh2_connect('shell.example.com'22, array('hostkey'=>'ssh-rsa'));

if (
ssh2_auth_hostbased_file($connection'remoteusername''myhost.example.com',
                             
'/usr/local/etc/hostkey_rsa.pub',
                             
'/usr/local/etc/hostkey_rsa''secret',
                             
'localusername')) {
  echo 
"Public Key Hostbased Authentication Successful\n";
} else {
  die(
'Public Key Hostbased Authentication Failed');
}
?>

Anmerkungen

Hinweis:

ssh2_auth_hostbased_file() requires libssh2 >= 0.7 and PHP/SSH2 >= 0.7

Hier Kannst Du einen Kommentar verfassen


Bitte gib mindestens 10 Zeichen ein.
Wird geladen... Bitte warte.
* Pflichtangabe
Es sind noch keine Kommentare vorhanden.

Was genau bedeutet "Vibe Coding"? Ein tiefgehender Blick für Entwickler

In der Welt der Softwareentwicklung gibt es unzählige Wege, wie man an ein Projekt herangeht. Manche schwören auf strikte Planung, andere auf bewährte Algorithmen und wieder andere lassen sich von etwas ganz anderem leiten: ihrem Gefühl. ...

admin

Autor : admin
Kategorie: Software & Web-Development

PHP cURL-Tutorial: Verwendung von cURL zum Durchführen von HTTP-Anfragen

cURL ist eine leistungsstarke PHP-Erweiterung, die es Ihnen ermöglicht, mit verschiedenen Servern über verschiedene Protokolle wie HTTP, HTTPS, FTP und mehr zu kommunizieren. ...

TheMax

Autor : TheMax
Kategorie: PHP-Tutorials

Midjourney Tutorial - Anleitung für Anfänger

Über Midjourney, dem Tool zur Erstellung digitaler Bilder mithilfe von künstlicher Intelligenz, gibt es ein informatives Video mit dem Titel "Midjourney Tutorial auf Deutsch - Anleitung für Anfänger" ...

Mike94

Autor : Mike94
Kategorie: KI Tutorials

Tutorial veröffentlichen

Tutorial veröffentlichen

Teile Dein Wissen mit anderen Entwicklern weltweit

Du bist Profi in deinem Bereich und möchtest dein Wissen teilen, dann melde dich jetzt an und teile es mit unserer PHP-Community

mehr erfahren

Tutorial veröffentlichen

Arabica coffee beans +256790560642 coffee Robusta Crafted to Export

COFFEE KAWA EXPORTER – From Our Farms to Your Cup Experience the True Taste of Origin Call +256790560642 Email: coffeekawwa@gmail.com We special ...

Geschrieben von mogashoa am 22.06.2026 11:41:03
Forum: SQL / Datenbanken
Bazooka male vitality pills +256793306060 Mutuba -mulondo enlargement supplements

Manhood Specialist https://nativewitchspells.com/ WhatsApp: +256759011277 Calls: +256793306060 Email: bbaantu@gmail.com Free Fast Delivery Manhood ...

Geschrieben von mogashoa am 22.06.2026 11:38:57
Forum: PHP Developer Forum
Gay/Lesbian Love Spells+256793306060 lost love spells White Magic ex-lover back

Powerful Spells Caster https://nativewitchspells.com/ Text: +256759011277 / +256793306060 Email: bbaantu@gmail.com Find, Rekindle, or Deepen Love ...

Geschrieben von mogashoa am 22.06.2026 11:27:45
Forum: Webmaster
Lesbian-Gay Karma love spells caster+256793306060 lost love spells bonds couple union

Powerful Spells Caster https://nativewitchspells.com/ Text: +256759011277 Phone Call: +256793306060 Email: bbaantu@gmail.com Real Magic Spells How ...

Geschrieben von mogashoa am 22.06.2026 11:16:05
Forum: PHP Developer Forum