Skip to main content

Command Palette

Search for a command to run...

Access Ubuntu Server Shell Using GitHub Actions

How to Access Ubuntu Server Shell with GitHub Actions

Updated
2 min read
Access Ubuntu Server Shell Using GitHub Actions
A

Infosec Poet and CAP-certified DevOps/SecOps Engineer, passionate about security, creativity, and continuous learning.

Tasks

  • Use GitHub Actions to Access the Ubuntu Server Shell.

  • Ensure the shell can be accessed on tty and any browser, allowing easy access from anywhere.

Steps

  1. First of all we should have github account. If you don’t have create github account.
    https://github.com/

  2. Create a new repository from your github account.

    https://github.com/new

    Repo name - Random
    Make sure to set it to public; choosing private will incur a charge.

  3. Now we have our own repo. Assuming you also have your own repo.

  4. Let’s dive to sshx - A secure web-based, collaborative terminal.

    https://sshx.io/

    Find github : https://github.com/ekzhang/sshx

  5. We are going to use the CI/CD features from here. So get the yaml from here.

     name: CI
     on: push
    
     jobs:
       build:
         runs-on: ubuntu-latest
         steps:
           - uses: actions/checkout@v3
    
           # ... other steps ...
    
           - run: curl -sSf https://sshx.io/get | sh -s run
           #      ^
           #      └ This will open a remote terminal session and print the URL. It
           #        should take under a second.
    
  6. Copy and create a github actions workflow

    https://github.com/abisecops/shellx/actions/new

  7. /.github/workflows → anything.yaml; For me I’m using shellx.yaml. Then paste the above yaml here.

  8. Commit changes

  9. Check workflow from actions now

    https://github.com/abisecops/shellx/actions

  10. Click on build

  11. We got `sshx shell link here.

  12. Now we can access tty shell from the link

  13. Try root shell now use given command. Lol simple but use it.

    cd 
    sudo su 
    cd
    whoami
    

    I’m the root kiddo :p

  14. Install neofetch now.

    apt install neofetch
    
  15. Now we can use see server info. I just love this, nothing more.

    neofetch

This server will run for 6 hours after the build. After that, you need to rebuild it. You can also set up a cron job here if needed.

Be careful adding this to a public GitHub repository, as any user can view the logs of a CI job while it is running.

#linux #githubactions #sshx #happylearning

Linux

Part 1 of 2

In this series, I will cover Linux fundamentals, system administration, command-line tips, troubleshooting, security, and performance tuning.

Up next

Custom Apache User Setup

How to Set Up a Custom Apache User