• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

/etc/psa/psa.key missing ?

J

JarekG

Guest
Hi,

I'm writing some scripts which automate some tasks in Plesk and they also update our database about keys, licenses and so on. The problem is I faced with the wall as on some Plesk installations /etc/psa/psa.key exists on some not. I tried to use /usr/local/psa/admin/keymng but on Plesk 9 option --fetch is no longer available. I have found some xml format key file in /etc/sw/keys. But... it's not also common for all Plesks. Is there any way to get psa.key in right place where it should be ?

Thank you for your help.

Regards.
 
​Parallels Panel key's files is storing in %plesk_dir%\admin\repository\keys folder for Windows and /etc/sw/keys/keys/ for Unix. Each file with random name is for one key. You can find necessary key by reading the content, and then do what you want.
 
Dear Jarek,

The following command line is functioning OK for me to display Plesk key number in Plesk 9.3.0 for Linux:

# tr -d "\r\n" </etc/sw/keys/registry.xml | sed -e 's!^.*<member><name>active</name><value><struct><member><name>\([^<]\+\)</name>.*$!\1!';echo

--
Eduard Haritonov
 
Of course, parsing XML would be more correct solution, for example in PHP:

Code:
function get_psa9_key () {
    $registry_fn = '/etc/sw/keys/registry.xml';
    $registry_xml = file_get_contents ($registry_fn);
    $sxml = new SimpleXMLElement ($registry_xml);
    $a_obj = $sxml->struct->member;
    foreach ($a_obj as $obj)
        if ($obj->name == 'active')
            return (string) $obj->value->struct->member->name;
    return FALSE
}
 
Last edited:
Привет Эдик!

Рад видеть тебя тут с твоей помощью :)

Это я, Игорь Губайдуллин.
 
OK I sorted it out for Linux. Now I've got a problem with windows.

I'm trying to run that command from hardware node level and if I do like:

vzctl exec CTID "echo %plesk_dir%"

it returns an error 0x2. When I do it from CTID it works. Where is the problem ?
 
Back
Top