• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question Global sttings of HSTS via CLI

MartinT

Basic Pleskian
Server operating system version
Debian 10.13 Buster
Plesk version and microupdate number
Plesk Obsidian Version 18.0.49
Hi,
on my plesk admin-web-server I got many many Subscriptions. After a Server Issue I had to backup, but now all subscritions are not resolveable. I tested out why, its something with HSTS. A switch of will make everything fine. So is it possible to switch global all subscriptons on "false" via cli plesk-bin-site? And when it work the step back to "true". I did not find anything. At How to enable HTTP Strict-Transport-Security (HSTS) and OCSP Stapling for all domains in Plesk? - Support Cases from Plesk Knowledge Base is something to switch it on, but for switch off?
 
Tried it out. Here is the outcome:

Invalid command: 'default'
exit status 3
Invalid command: 'default'
exit status 3
Invalid command: 'default'
exit status 3
Invalid command: 'default'
exit status 3
 
The domains.txt file contains a list of your domains? Does it? Or does it also contain empty lines or something else but domains?
 
Ah, yes, I just noticed there is an additional dash (-) missing in hsts option of the CLI command. It should be --hsts. (The dash is also missing in the example code in the support article, which I copied). So the whole command should be:
Code:
# for i in `cat domains.txt`; do plesk ext sslit --hsts -enable -domain $i; done
 
Last edited:
@Peter Debik
No empty lines
@Kaspar
That was it, except ...; do plesk ...." not only plesk like in your first answer.
By the way the Plesk solution site has same "bash" mistake at "list". So in whole no it works.

If it interupts the building its because sql database got an empty subscription id. my work around is to overwork domain.txt and restart at that place where in interrupts.

So far thanks Kaspar and Peter
 
Ah, yes, I just noticed there is an additional dash (-) missing in hsts option of the CLI command. It should be --hsts. (The dash is also missing in the example code in the support article, which I copied). So the whole command should be:
Code:
# for i in `cat domains.txt`; do plesk ext sslit --hsts -enable -domain $i; done
I remember that a similar case happened here on the forum recently. It seems to be a formatting issue for all these excerpts. I have informed the responsible team here to look into it and correct these code examples. Thank you for explaining it here again.
 
Back
Top