S
S
Sergey2015-08-04 11:02:35
PHP
Sergey, 2015-08-04 11:02:35

How to pass the contents of the SSH key to the function instead of the path?

The point is this. At the moment, the usual bundle of php-> ssh-> HyperVisors on different platforms is working on the Ubuntu server. There was a need to hide ssh keys from the file system in the database. Exaggerated, authentication is done via
$auth = ssh2_auth_pubkey_file($connection, $user, '.ssh/id_dsa.pub', '.ssh/id_dsa', $pass);
I tried to serve the contents of files instead of '.ssh/id_dsa.pub', '.ssh/id_dsa' via file_get_contents and reading from the database - the function requires the file. How to cheat?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Max, 2015-08-04
@MaxDukov

the function only accepts a file name - by design. Either log in with a password, or rewrite the function.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question