Get Virtualizor

List SSH Keys

Use the list ssh keys API to get API keys added by user.

HTTP Request

https://hostname:4085/index.php?act=users&list_ssh_keys=1

Parameters

NameMethodValueDescriptionRequired
actGETusersThe action specified to retrieve dataYes

Sample Code

<?php

    require_once('/usr/local/virtualizor/sdk/admin.php');

    $key =  'your_api_key';
    $pass = 'your_api_pass';
    $ip = 'your_server_ip';

    $admin = new Virtualizor_Admin_API($ip, $key, $pass);

    $uid = 3582;

    $output = $admin->list_ssh_keys($uid);

    print_r(json_encode($output));

?>

Output

{
"ssh_keys":{
"14":{
"keyid":"14",
"name":"ssh_key_auto_spjpgk5nsiohvxz9",
"value":"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7IqAlA86ZUABy0TSCc... root@lxc"
}
}
}
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list