Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Workaround for file permission conflicts #84

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 46 additions & 2 deletions src/guides/node/native.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,18 +215,56 @@ 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 `/srv/rocketpool` to `rp`, to prevent permission conflicts:

```
chown -R rp:rp /srv/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:
```
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`:

```
<user> ALL=(ALL) NOPASSWD: RP_USER_CMDS
```

where `<user>` 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
<user> ALL=(ALL) NOPASSWD: RP_USER_CMDS
```
Finally, run the Rocket Pool configuration:
```
rp service config
Expand Down Expand Up @@ -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
<user> ALL=(ALL) NOPASSWD: RP_USER_CMDS
rp ALL=(ALL) NOPASSWD: RP_CMDS
```

Expand Down Expand Up @@ -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
<user> ALL=(ALL) NOPASSWD: RP_USER_CMDS
rp ALL=(ALL) NOPASSWD: RP_CMDS
```

Expand Down Expand Up @@ -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 <validator service name>

# User privilege specification
root ALL=(ALL:ALL) ALL
<user> ALL=(ALL) NOPASSWD: RP_USER_CMDS
rp ALL=(ALL) NOPASSWD: RP_CMDS
```

Expand Down