Create Connecting With SSH authored by Devin's avatar Devin
# Basic SSH Guide
If you need to access the FRPG server, you will need to connect to it via an SSH tunnel.
You will need two programs installed on your machine:
- An SSH program
- The school's VPN (if you are not connected to a campus network)
<br>
# Installing SSH
Chances are, whatever machine you are on, it comes with SSH pre-installed. To check if this is true for your machine, do the following:
- Open a command prompt or terminal
- Type `ssh` and hit enter
If you get a message like "`'ssh' is not recognized as an internal or external command, operable program or batch file`", then you do not have an installed. Follow the guide here to install it:
- [OpenSSH Install Guide]( https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse?tabs=gui )
<br>
# Installing the VPN
Follow this guide to install the VPN:
- https://web.engr.ship.edu/for-students/vpn-instructions/
# How to Connect
Before connecting to the server:
- Connect to the VPN
- Make sure you have a command prompt or terminal open.
You will need some information to login:
- Username
- Server address (like `example.com`)
- Password
- 2FA token
You can get this information from Dr. Wellington.
The SSH command, generally, to connect to a remote server looks like this:
- `ssh username@example.com`
Replace `username` and `example.com` accordingly, and you will be prompted for a password, then a 2FA token.
Once you're logged in, you can now run commands and manage the servers.
<br>
# Basic commands
- `ls` - lists files and folders
- `cd <name>` - moves into the a folder
- `cat <name>` - shows the contents of a file
- `nano <name>` - basic text editor, opens a file
<br>
# FRPG command
- `frpg` - shows the FRPG help menu
- `frpg up` - runs all the Docker containers
- `frpg down` - stops all the Docker containers
- `frpg compose ps` - list all the Docker containers
<br>
# Docker commands
To run commands within a Docker container, this format:
- `docker exec -it <container_name> <command>`
For example, if you want to access the database and run queries:
- `docker exec -it frpg_mysql mysql`
Run commands directly in the `frpg_mysql` container (in the same way you're running commands now):
- `docker exec -it frpg_mysql bash`
To exit the container if you've run `bash` on it:
- `exit`
To list Docker containers:
- `frpg compose ps`