From efdc475c6eee7f601d84607c185d4a2ceb1e540e Mon Sep 17 00:00:00 2001 From: JanK Date: Wed, 9 Mar 2022 22:34:33 +0100 Subject: [PATCH 1/2] Added workaround for file permission conflicts --- src/guides/node/native.md | 48 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/src/guides/node/native.md b/src/guides/node/native.md index 88846941..6be1aea3 100644 --- a/src/guides/node/native.md +++ b/src/guides/node/native.md @@ -215,9 +215,15 @@ Now, open `config.yml` in `nano` or your editor of choice, and make the followin - Change `chains.eth1.wsProvider` to `wsProvider: ws://127.0.0.1:8546` - Change `chains.eth2.provider` to `provider: http://127.0.0.1:5052` +Change the owner of all files in `/src/rocketpool` to `rp`, to prevent permission conflicts: + +``` +chown -R rp:rp /src/rocketpool +``` + Now open `~/.profile` with your editor of choice and add this line to the end: ``` -alias rp="rocketpool -d /usr/local/bin/rocketpoold -c /srv/rocketpool" +alias rp="sudo -u rp /usr/local/bin/rocketpool -d /usr/local/bin/rocketpoold -c /srv/rocketpool" ``` Save it, then reload your profile: @@ -225,8 +231,40 @@ Save it, then reload your profile: source ~/.profile ``` -This will let you interact with Rocket Pool's CLI with the `rp` command, which is a nice shortcut. +This will let you interact with Rocket Pool's CLI with the `rp` command, which is a nice shortcut. In order to prevent permission conflicts, you need to run the `rp` alias as the `rp` user, so you will need to edit the `sudoers` file: + +``` +sudo nano /etc/sudoers +``` + +Add this line under `# Cmnd alias specification` + +``` +Cmnd_Alias RP_USER_CMDS = /usr/local/bin/rocketpool -d /usr/local/bin/rocketpoold -c /srv/rocketpool +``` + +In command line enter + +``` +echo $USER +``` + +Add this line under `# User privilege specification`: + +``` + ALL=(ALL) NOPASSWD: RP_USER_CMDS +``` + +where `` is the output of the echo command. That whole section should now look like this: + +``` +# Cmnd alias specification +Cmnd_Alias RP_USER_CMDS = /usr/local/bin/rocketpool -d /usr/local/bin/rocketpoold -c /srv/rocketpool +# User privilege specification +root ALL=(ALL:ALL) ALL + ALL=(ALL) NOPASSWD: RP_USER_CMDS +``` Finally, run the Rocket Pool configuration: ``` rp service config @@ -702,10 +740,12 @@ rp ALL=(ALL) NOPASSWD: RP_CMDS That whole section should now look like this: ``` # Cmnd alias specification +Cmnd_Alias RP_USER_CMDS = /usr/local/bin/rocketpool -d /usr/local/bin/rocketpoold -c /srv/rocketpool Cmnd_Alias RP_CMDS = /usr/bin/systemctl restart nimbus # User privilege specification root ALL=(ALL:ALL) ALL + ALL=(ALL) NOPASSWD: RP_USER_CMDS rp ALL=(ALL) NOPASSWD: RP_CMDS ``` @@ -873,10 +913,12 @@ rp ALL=(ALL) NOPASSWD: RP_CMDS That whole section should now look like this: ``` # Cmnd alias specification +Cmnd_Alias RP_USER_CMDS = /usr/local/bin/rocketpool -d /usr/local/bin/rocketpoold -c /srv/rocketpool Cmnd_Alias RP_CMDS = /usr/bin/systemctl restart nimbus # User privilege specification root ALL=(ALL:ALL) ALL + ALL=(ALL) NOPASSWD: RP_USER_CMDS rp ALL=(ALL) NOPASSWD: RP_CMDS ``` @@ -1196,10 +1238,12 @@ rp ALL=(ALL) NOPASSWD: RP_CMDS That whole section should now look like this: ``` # Cmnd alias specification +Cmnd_Alias RP_USER_CMDS = /usr/local/bin/rocketpool -d /usr/local/bin/rocketpoold -c /srv/rocketpool Cmnd_Alias RP_CMDS = /usr/bin/systemctl restart # User privilege specification root ALL=(ALL:ALL) ALL + ALL=(ALL) NOPASSWD: RP_USER_CMDS rp ALL=(ALL) NOPASSWD: RP_CMDS ``` From 61c7dddbc6e6259cce1fe359e85fee8a0082df21 Mon Sep 17 00:00:00 2001 From: JanK Date: Wed, 9 Mar 2022 22:45:23 +0100 Subject: [PATCH 2/2] Spelling error --- src/guides/node/native.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/guides/node/native.md b/src/guides/node/native.md index 6be1aea3..1df99ab2 100644 --- a/src/guides/node/native.md +++ b/src/guides/node/native.md @@ -215,10 +215,10 @@ Now, open `config.yml` in `nano` or your editor of choice, and make the followin - Change `chains.eth1.wsProvider` to `wsProvider: ws://127.0.0.1:8546` - Change `chains.eth2.provider` to `provider: http://127.0.0.1:5052` -Change the owner of all files in `/src/rocketpool` to `rp`, to prevent permission conflicts: +Change the owner of all files in `/srv/rocketpool` to `rp`, to prevent permission conflicts: ``` -chown -R rp:rp /src/rocketpool +chown -R rp:rp /srv/rocketpool ``` Now open `~/.profile` with your editor of choice and add this line to the end: