Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
To set up and use the HIL workflows, you must create a GitHub Actions runner on the server. You’ll need higher-level permissions to create the runner, and you should double-check that the runner name matches what’s specified in the workflows.
38 changes: 38 additions & 0 deletions .github/workflows/active-session.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# .github/workflows/update-active-user.yml
name: Active User Script
#when the active_user.sh is updated in the repo it will update the copy on the server
on:
push:
branches:
- main
paths:
- "Show active users/active-sessions.sh"

#allows manual triggering of the workflow
workflow_dispatch:

#replaces the old active_user.sh with the new one in the repo
jobs:
update_script:
runs-on: [self-hosted, linux]

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Deploy active_user.sh
run: |
NEW_SCRIPT_PATH="${{ github.workspace }}/Show active users/active-sessions.sh"
PROFILE_SCRIPT_PATH="/etc/profile.d/active-sessions.sh"

if [ -f "$NEW_SCRIPT_PATH" ]; then
sudo /usr/bin/cp "$NEW_SCRIPT_PATH" "$PROFILE_SCRIPT_PATH"
sudo /usr/bin/chmod +x "$PROFILE_SCRIPT_PATH"
echo "active-sessions.sh updated successfully in $PROFILE_SCRIPT_PATH"
else
echo "Error: active_user.sh not found in repo folder!"
exit 1
fi

- name: Log update
run: echo "active-sessions.sh now runs active_user.sh at login."
39 changes: 39 additions & 0 deletions .github/workflows/create-user.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

name: create user script

#when the create_user.sh is updated in the repo it will update the copy on the server
on:
push:
branches:
- main
paths:
- "new user creator/create_user.sh"

#allows manual triggering of the workflow
workflow_dispatch:

#replaces the old create_user.sh with the new one in the repo
jobs:
update_script:
runs-on: [self-hosted, linux]

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Replace local create_user.sh
run: |
NEW_SCRIPT_PATH="${{ github.workspace }}/new user creator/create_user.sh"
LOCAL_SCRIPT_PATH="/usr/local/bin/create_user.sh"

if [ -f "$NEW_SCRIPT_PATH" ]; then
sudo /usr/bin/cp "$NEW_SCRIPT_PATH" "$LOCAL_SCRIPT_PATH"
sudo /usr/bin/chmod +x "$LOCAL_SCRIPT_PATH"
echo "create_user.sh updated successfully in $LOCAL_SCRIPT_PATH"
else
echo "Error: create_user.sh not found in repo folder!"
exit 1
fi

- name: Log update
run: echo "create_user.sh has been replaced with the latest version from the repo."
41 changes: 41 additions & 0 deletions .github/workflows/update-HIL.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

name: Update Local Script

#when the update.sh is updated in the repo it will update the copy on the server
on:
push:
branches:
- main
paths:
- "update hil/update.sh"

#allows manual triggering of the workflow
workflow_dispatch:

#replaces the old update.sh with the new one in the repo
jobs:
update_script:
runs-on: [self-hosted, linux]

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Replace local update.sh
run: |
NEW_SCRIPT_PATH="${{ github.workspace }}/update hil/update.sh"

LOCAL_SCRIPT_PATH="$HOME/update.sh"

if [ -f "$NEW_SCRIPT_PATH" ]; then
cp "$NEW_SCRIPT_PATH" "$LOCAL_SCRIPT_PATH"
chmod +x "$LOCAL_SCRIPT_PATH"
echo "update.sh updated successfully in $HOME"
else
echo "Error: update.sh not found in repo folder 'update hil'!"
exit 1
fi


- name: Log update
run: echo "update.sh has been replaced with the latest version from the repo."
131 changes: 131 additions & 0 deletions Remote-Access/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@

---

# Remote Access Setup Using DuckDNS and Clemson VPN

This guide explains how to set up remote SSH access to your local server using a Dynamic DNS (DDNS) service such as DuckDNS. It also includes instructions to automatically update your public IP address so you can reliably connect even if it changes.

---

## Overview

1. **DuckDNS** (or another DDNS provider) assigns your home server a persistent domain name (for example, `example.duckdns.org`).
2. **Cron** and **curl** automatically keep your DuckDNS record updated with your current public IP address.
3. **Clemson VPN** allows secure remote access when off-campus.
4. **SSH** provides a secure connection to the server

---

## Step 1: Set Up a DuckDNS Domain

1. Go to [https://www.duckdns.org](https://www.duckdns.org)
2. Log in using a supported account (GitHub, Google, etc.).
3. Create a new subdomain, for example:

```
example.duckdns.org
```
4. Copy your **token** — you will need it for the update script.

---

## Step 2: Install Dependencies

Make sure both `curl` and `cron` are installed on your server:

```bash
sudo apt update
sudo apt install curl cron -y
```

---

## Step 3: Set Up DuckDNS Update Script

1. Create a new directory for DuckDNS:

```bash
mkdir -p ~/duckdns
cd ~/duckdns
```

2. Create the update script:

```bash
nano duck.sh
```

3. Paste the following code (replace with your DuckDNS domain and token):

```bash
echo "url=https://www.duckdns.org/update?domains=example&token=YOUR_TOKEN&ip=" | curl -k -o ~/duckdns/duck.log -K -
```

4. Save and make it executable:

```bash
chmod 700 ~/duckdns/duck.sh
```

---

## Step 4: Schedule Automatic Updates with Cron

Edit your crontab to run the update automatically:

```bash
crontab -e
```

Add these lines at the bottom:

```
*/5 * * * * ~/duckdns/duck.sh >/dev/null 2>&1
@reboot ~/duckdns/duck.sh >/dev/null 2>&1
```

This will:

* Run the DuckDNS update every 5 minutes.
* Run it once at boot to immediately refresh your IP.

To verify it’s running:

```bash
cat ~/duckdns/duck.log
```

---

## Step 5: Connect via SSH

Once set up, you can SSH into your server using your DuckDNS address:

```bash
ssh user@example.duckdns.org
```

Replace `user` with your server’s username.

---

## Step 6: Remote Access via Clemson VPN

When off-campus, use Clemson’s Cisco VPN (the same one used for iRoar and other Clemson services):

1. Connect to the Clemson VPN using Cisco AnyConnect.
2. After connecting, SSH into your server the same way as before:

```bash
ssh user@example.duckdns.org
```

---

## Optional: Use DuckDNS Docker Container Instead of the Script

DuckDNS also provides an official Docker container that handles automatic IP updates.
You can find the docker image here:
[DuckDNS Docker Image](https://hub.docker.com/r/linuxserver/duckdns)

---
77 changes: 77 additions & 0 deletions Show active users/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@

---

## Active Sessions Script Setup

This script displays a custom welcome message when users log in, showing:

* Who is connected
* When they connected
* How long they’ve been connected
* Whether they are idle

It replaces the default **message of the day (MOTD)** with custom information.

---

### 1. Copy the Script

Copy the script from GitHub into:

```bash
sudo nano /etc/profile.d/active-sessions.sh
```

Paste the script, then save and exit.

---

### 2. Make It Executable

```bash
sudo chmod +x /etc/profile.d/active-sessions.sh
```

---

### 3. Disable the Default MOTD

To hide the default login message:

```bash
sudo chmod -x /etc/update-motd.d/*
```

To re-enable it later if needed:

```bash
sudo chmod +x /etc/update-motd.d/*
```

---

### 4. Set the Time Zone

Set your system to the Eastern Time zone:

```bash
sudo timedatectl set-timezone America/New_York
```

---

### 5. Edit or Remove the Script

To edit:

```bash
sudo nano /etc/profile.d/active-sessions.sh
```

To delete:

```bash
sudo rm /etc/profile.d/active-sessions.sh
```

---
Loading