Runme via SSH
Runme is committed to delivering an exceptional experience right from the start. By using Runme, and VS Code's native-SSH capabilities 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.
💡 Note: Runme harnesses VS Code's Remote Development extensions to attach VS Code to remote SSH hosts.
To set up your SSH key configuration, follow the steps below:
- Generate an SSH key if you haven't already.
- Identify the remote host you want to connect to and make sure you have the necessary login credentials.
- Ensure that you have Visual Studio Code installed on your local machine.
- Install the Runme extension in Visual Studio Code.
- Use the Visual Studio Code Remote - SSH extension to connect to the remote host via SSH.
- Install the Runme extension on the remote server and leverage the notebook UX to execute what you want.
- Create a block of code called
commandto execute the desired actions on the remote host.
Example: how to use Runme attached to SSH host
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:
- Set up your SSH key configuration by following the instructions here.
- Remote server: Make sure you have access to the remote server and the necessary permissions to execute commands.
- Create a Markdown file: Create a
.mdfile that will connect to the remote server and execute the desired commands.
- In the
.mdfile, create a block of code that uses the SSH command to connect to the remote server and execute the desired command.
Example: how to use ssh inside of notebooks
ssh firstname.lastname@example.org 'bash -s' < script.sh
This command will run a bash script called
script.sh on the remote server. Make sure to replace
remote.server.com with your own username and the server's hostname or IP address.
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.
- Execute the Runme command:
# short for "runme tui" is
- Select the markdown file
.mdyou want to execute (if you have multiple
.mdfiles or different codeblocks and instruction in a
Example: how ssh into remote hosts from a notebook
If you need to securely copy files between your local machine and the remote server, you can install SCP on your machine.
Setup SSH Connection
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.