# 2.0 Adding Users to Docker Group

---

<span style="color: rgb(0, 0, 0);">*\*Must be done on each docker node if there's more than one*</span>

<p class="callout info"><span style="color: rgb(45, 194, 107);">**<span style="color: rgb(35, 111, 161);">\*Any confusion on command syntax/structure can be clarified in </span><span style="color: rgb(22, 145, 121);">[Legend](https://wiki.raspberrypiclub.org/books/how-to-refer-to-the-documentation/page/legend)</span>** </span></p>

<div align="left" dir="ltr" id="bkmrk-docker-swarm-nodes-i"></div>1. <span style="color: rgb(0, 0, 0);">Login to the docker node</span>

2. <span style="color: rgb(0, 0, 0);">Add the user</span>

<p class="callout info"><span style="color: rgb(35, 111, 161);">**\*Set the password to something easy i.e. password // can also be changed using the 'passwd' command**</span></p>

```
sudo adduser [USER]
```

3. <span style="color: rgb(0, 0, 0);">Give user permission to the docker and sudoers group</span>

```
sudo usermod -aG docker [USER]
sudo usermod -aG sudo [USER]
```

4. <span style="color: rgb(0, 0, 0);">Connect to user’s account and import user’s Github keys</span>

```
su [USER]
ssh-import-id-gh [GITHUB USERNAME]
```

5. <span style="color: rgb(0, 0, 0);">Test whether or not the user can connect to each docker swarm:</span>

```bash
ssh [USER]@[IP ADDRESS]
```

6. <span style="color: rgb(0, 0, 0);">Have user change their password NOT ON ROOT on each docker node created:</span>

```
passwd 
```

<span style="color: rgb(0, 0, 0);">*Last Updated: 2/22/2025* </span><span style="color: rgb(0, 0, 0);">*Contributors: Lilian, Vivian*</span>