• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

/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