-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
how about the private key access modes, chmod, or chown or umask
neil edited this page Aug 24, 2020
·
6 revisions
A short answer is: we deal with the file permission as little as possible.
A longer answer is: we almost don't change the file permissions, you set it yourself, and it will be kept forever.
Ok, let me give a longer answer:
- By default, the key/cert files are saved in
~/.acme.sh
, this folder is set to mode700
by default. So, nobody else can read your private key. - When you use
--install-cert
command to copy the cert to the target locations, we usecat keyfile > target_key_file
pattern, in which the target file permission is not changed, and you only need write permission to the target file. Yes, if the target file doesn't exist for the first time, it will be created with your default umask, which is umask 022 in most of the unix/linux systems. In this case, somebody else may read your private key file. But you can change the file mode manually,chmod 600 target_key_file
. The reasons why we don't change the file mode are:- We respect the users choice most. We trust you more than ourselves. you can change the file modes manually, you know your system best. We respect your choice.
- We can not use
umask
also. In webroot mode, we have to create validation file, if umask is set to022
, the webserver would not be able to read the validation file.
So, doing more doesn't mean doing better. Less is more.
Buy me a beer, Donate to acme.sh if it saves your time. Your donation makes acme.sh better: https://donate.acme.sh/
如果 acme.sh 帮你节省了时间,请考虑赏我一杯啤酒🍺, 捐助: https://donate.acme.sh/ 你的支持将会使得 acme.sh 越来越好. 感谢