Skip to main content

Runme via SSH

Runme is committed to delivering an exceptional experience right from the start. By using Runme, you can easily connect to an instance and carry out specific instructions using markdown docs. Before exploring various ways to utilize Runme through SSH, it's important to make sure that you have installed Runme for VS Code or CLI by referring to the installation guide, as well as ensuring that you have access to the remote server you need.

VS Code Remote Development

Using runme on a remote server with VSCode enhances efficiency by streamlining the execution of tasks. It minimizes the need for manual commands, automating repetitive tasks, thereby saving time and reducing errors. This approach also optimizes performance by ensuring consistent and reliable execution of scripts and processes, ultimately improving the development workflow.

SSH Connection:

To set up your SSH key configuration, follow the steps below:

  1. Generate an SSH key if you haven't already.
  2. Identify the remote host you want to connect to and make sure you have the necessary login credentials.
  3. Ensure that you have Visual Studio Code installed on your local machine.
  4. Install the Runme extension in Visual Studio Code.
  5. Use the Visual Studio Code Remote - SSH extension to connect to the remote host via SSH.
  6. Install the Runme extension on the remote server and leverage the notebook UX to execute what you want.
  7. Create a block of code called command to execute the desired actions on the remote host.

Example

mkdir Vsc
cd Vsc
touch example.txt

ssh with Vsc

Key-Based Authentication

To enhance security when using Runme, it is recommended to use SSH keys for authentication. This eliminates the need for password transmission and reduces the risk of brute-force attacks.

To execute commands on a remote server using Runme, follow these steps:

  1. Set up your SSH key configuration by following the instructions here.
  2. Remote server: Make sure you have access to the remote server and the necessary permissions to execute commands.
  3. Create a Markdown file: Create a .md file that will connect to the remote server and execute the desired commands.
  4. In the .md file, create a block of code that uses the SSH command to connect to the remote server and execute the desired command. Here is an example:
ssh user@remote.server.com 'bash -s' < script.sh

This command will run a bash script called script.sh on the remote server. Make sure to replace user and remote.server.com with your own username and the server's hostname or IP address.

Additionally, if you need to securely copy files between your local machine and the remote server, you can install SCP on your machine.

Example 2:

scp /path/to/bash/script user@host:/path/on/remote/server
ssh user@host 'bash /path/on/remote/server/script.sh'

This is an example of running bash script in a server

Bash

Replace username and your_server_ip with the appropriate SSH username and host address, and command with the command you want to execute on the remote server.

By following these steps and using SSH keys for authentication, you can enhance the security of your Runme commands and reduce the risk of unauthorized access or attacks.

  1. Execute the Runme command:
# short for "runme tui" is 
runme
  1. Select the markdown file .md you want to execute (if you have multiple .md files or different codeblocks and instruction in a .md)

runme