-
Notifications
You must be signed in to change notification settings - Fork 38.7k
systemd service script: set usable permissions on /etc/bitcoin config dir #15995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…y. Additionally add protection for /home.
Providing
It looks good from the security point of view. Why is this an issue? |
It's now happened to me a couple of times where I've installed the service script and overlooked creating the config file. I then check the log messages realise it's missing and copy it into the
To fix the problem the ownership of
Another possible fix would be to remove the |
IMO, there is nothing to fix in the software ;) |
Point taken and not disputed ;). Wish I could get my memory banks serviced. I keep cleaning them with alcohol but it just seems to make it worse :(. For any other interested parties the choices I see are:
As a point of reference on my ubuntu system most configuration directories including |
ryanofsky
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK c6d765c
Restarting the bitcoin service will continue to fail because the permissions on /etc/bitcoin are incorrect.
This does seem like an annoyance worth fixing, and I think the current PR changing permissions from:
drwx--x--- root root /etc/bitcoin
drwxr-xr-x root root /etc/bitcoin
0710 -> 0755 seems fine. Other options would be 0711:
drwx--x--x root root /etc/bitcoin
Or to keep the current 0710 but change the group:
drwx--x--- root bitcoin /etc/bitcoin
with something like:
PermissionsStartOnly=true
ExecStartPre=chgrp bitcoin /etc/bitcoin
|
I'm not convinced that this is a good idea. |
|
@laanwj the PR doesn't affect the permissions on the bitcoin.conf file. It affects the permissions that systemd will set on the |
|
Concept NACK. Rationale:
Yes, it does. It affects the permissions on the |
|
Ok I'll accept that the proposed solution is not ideal and close this PR. In my defense I will point out that my goal was to avoid future users of the sample systemd This is the error that occurs if I take the same steps I've use to set up dozens of systemd services on Ubuntu. @hebasto You are right*.
There's too much beer to drink to worry about |
|
Just stumbled across this same issue and contributed my own fix with |
|
I disagree with some points made in this discussion.
False; this just sets the location where
This looks like it might also need fixing; there is no point to separating the config file out from the writeable datadir if you are going to make the config dir writeable by the user executing the service; making the config file readable but not writeable by the user executing the service is the whole point of having separate data- and config dirs; this is also why systemd does not |
The current sample systemd script sets 0710 permissions on
/etc/bitcoinwhich means it can only be read by the owner. If/etc/bitcoindoes not exist when the systemd script is run for the first time then the directory gets created withrootas the owner. The 0710 permissions will/may prevent a non-root user from being able to list the directory (on Ubuntu 18.04 the file can be listed but the permissions are inaccessible).Even after copying
bitcoin.confto/etc/bitcoinit will remain unusable until either the directory permissions are changed or the service user is made the owner.This PR adjusts the permissions that the service script will set on
/etc/bitcoinso that all users can read and list the default config directory. A user will still have to copy the bitcoin.conf file to it but the adjustment will avoid them having to manually set permissions or change ownership of/etc/bitcoin.In addition the
ProtectHomeoption has been added. The rationale being if using a service to run bitcoind it's more likely to be a headless daemon that should not need access to user home directories.Best link I found for systemd [options].(https://www.freedesktop.org/software/systemd/man/systemd.exec.html#ConfigurationDirectory=)