How to create a connection via SSH using the key files: d_ed25519 id_ed25519.pub id_ed25519-cert.pub #1882
Unanswered
arhiopterecs
asked this question in
Q&A
Replies: 1 comment
-
Using phpseclib v3: use phpseclib3\Crypt\PublicKeyLoader;
use phpseclib3\Net\SSH2;
$key = PublicKeyLoader(file_get_contents('/path/to/id_ed25519'));
$ssh = new SSH2('website.com');
$ssh->login('username', $key);
echo $ssh->exec('ls -latr'); If your key is encrypted you'll need to pass a second parameter to $key = PublicKeyLoader(file_get_contents('/path/to/id_ed25519'), 'password'); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
quick question
I have 3 files:
id_ed25519
id_ed25519.pub
id_ed25519-cert.pub
Could you please show me how I can use this project to create a connection via SSH using the key files that I have?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions