# 2.0 Import SSH keys (on Debian Linux)

---

<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>

##### <span style="color: rgb(0, 0, 0);">**Importing Personal SSH Keys**</span>

<p class="callout info"><span style="color: rgb(35, 111, 161);">**Applicable to Personal / Home Lab setup**</span></p>

1. <span style="color: rgb(0, 0, 0);">Import the user’s GitHub keys so they can ssh from their computer:</span>
    
    
    - <span style="color: rgb(0, 0, 0);">If any new SSH keys from other devices are added, this command needs to be done again</span>

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

##### <span style="color: rgb(0, 0, 0);">**Importing Other User's SSH Keys**</span>

<p class="callout info"><span style="color: rgb(35, 111, 161);">**Applicable to the Raspberry Pi Club servers - allowing other *trusted* users ssh access to a system requires more steps:**</span></p>

1. <span style="color: rgb(0, 0, 0);">In the sys-admin’s shell, ssh into the system (e.g. node, VM, etc.) you want to give access to, and then escalate to superuser:</span>

```
sudo su -
```

2. <span style="color: rgb(0, 0, 0);">Create the new user and then add them to sudoers group:</span>
    
    
    - <span style="color: rgb(0, 0, 0);">Set an easy temporary password for the user (e.g. password)</span>

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

3. <span style="color: rgb(0, 0, 0);">Switch the newly created user account:</span>

```
sudo su [USER] -
```

4. <span style="color: rgb(0, 0, 0);">Import the user’s GitHub keys so they can ssh from their computer:</span>

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

5. <span style="color: rgb(0, 0, 0);">Have user ssh into the system and change their password into something secure:</span>
    
    
    - <span style="color: rgb(0, 0, 0);">If any new SSH keys from other devices are added, this command needs to be done again</span>

```
passwd
```

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