Skip to content
/ mavs-rc Public

Application to remote control computers via SSH/SFTP

License

Notifications You must be signed in to change notification settings

dubdia/mavs-rc

Repository files navigation

👋 Welcome

Mav's RC is an application designed to remotely control Linux systems through SSH/SFTP. It integrates multiple features into one seamless program, promoting ease of use without requiring any installations on the remote host.

Purpose and Open Source Spirit: Originally developed for personal use, I decided to open-source Mav's RC to contribute to the community—hoping it might assist others in managing their remote systems more efficiently. Feel free to contribute and please note, the application may contain bugs, and its use is at your own risk.

Compatibility Information: Built using Electron, Mav's RC is inherently multi-platform. However, it has been primarily tested on Windows 11. Testing on other platforms is planned, and your feedback is very welcome.

Features

Connect
  • Connect to Linux: Securely access Linux servers.
  • Authentication Options: Use password or public-key for authentication.
  • Remote Management: Manage multiple remote connections effectively.
Connect Screen
Shells
  • Integrated Shell: Execute commands and scripts directly within Mav's RC.
  • Multiple Shells: Spawn multiple shells next to each other
  • Clipboard support: Copy and paste between clipboard and shell with ease
Shell Screen
Scripts
  • Scripting support: Create scripts within Mav's RC to automate tasks or workflows between your local and the remote mashine. The scripts can be written in Typescript or Javascript. Better documentation is coming soon!
  • Powerful editor: The same editor that powers Visual-Studio Code is used here: Monaco
Scripts Screen
Services
  • Manage Services: Start, stop, enable, or disable services.
  • Logs and Monitoring: View and monitor service logs.
  • Service File Editor: Modify service files directly.
Service Screen
Explorer
  • File and Folder Exploration: Access and navigate files and folders on the remote system.
  • Permissions Management: Modify owner and permissions of the files and folders.
  • File Operations: Support for file and folder upload and download.
Explorer Screen
Editor
  • File Editing: Edit files directly on the remote system.
  • Advanced Options: Extended features for service file editing.
File Editor Screen
Tunnels
  • Tunnel Management: Set up and manage tunnels between localhost and remote systems.
  • Socks5 Support: Configure Socks5 proxies through tunnels.
  • Auto-connect: Option to automatically connect.
Tunnels Screen

🔥 Get started

This section guides you through downloading and setting up Mav's RC. Choose from downloading pre-built releases or building the application from source.

Download the Latest Release

You can download the latest version from our GitHub Releases Page. Please be aware that the executable is not code-signed, which may trigger a security warning on Windows.

Building from source

If you prefer to build the application yourself or wish to contribute to its development, follow these steps:

Prerequisites

Ensure that Node.js is installed on your system.

Steps

  1. Clone the repository or download the source:
    git clone https://github.com/dubdia/mavs-rc.git
    cd mavs-rc
  2. Install dependencies: npm install
  3. Build the application: npm run make

The built executable will be available in the /out directory.

Debugging from source

To debug Mav's RC during development:

  1. Follow the steps in Building from Source to set up the project.
  2. Start the application with: npm run start or open the workspace in VS Code and navigate to “Run” -> “Start Debugging” or simply press F5 to start the debugging session.

🤓 Logging

Mav's RC does log to the terminal and file-system to assist in monitoring and debugging. Here’s how logging is handled and how you can customize it:

Log File Location

  • Logs are created both in the terminal and in a dedicated file on the filesystem. On Windows systems, you can find the log file at: %APPDATA%\mavs-rc\rc.log

Data Privacy

  • SSH Credentials: To ensure security, SSH credentials are never logged.
  • SSH Traffic: For detailed information, SSH traffic can optionally be logged when the log level is set to verbose.

Customizing Log Levels

You’re able to adjust the verbosity of the logs through the application's configuration:

  • Configuration File: Modify the log level in the configuration file located at: %APPDATA%\mavs-rc\rc.config.json

  • The supported log levels are: error, warn, info, verbose

  • Default Level: The preset log level is info.


🛡️ Security

The security of Mav's RC is a core priority, especially considering the application’s interaction with sensitive data, such as SSH credentials. While achieving absolute security in an Electron-based application with multiple dependencies can be challenging, significant measures have been implemented to mitigate potential risks:

Enabled Security Features:

Electron Security Policies: Extensive use of Electron's security capabilities:

  • nodeIntegration set to false
  • contextIsolation enabled
  • webSecurity enforced
  • allowRunningInsecureContent set to false
  • Application sandboxing enabled

Content Security:

  • Content-Security-Policy (CSP): Implemented strict CSP in index.html to mitigate cross-site scripting (XSS) risks: script-src 'self'; worker-src 'self' blob:;

Network Security:

  • Network Requests: Electron configurations are in place to block unnecessary requests and redirects.
  • Data Bundling: No external data requests post-launch; all necessary data is pre-bundled.

Data Handling:

  • SSH Credentials: SSH credentials and traffic details are excluded from application logs to preserve confidentiality.
  • Fetch and XMLHttpRequest: Disabled native fetch and XMLHttpRequest functionalities in the renderer to reduce external attack vectors.

Maintenance and Auditing:

  • Dependency Audits: Regular audits with npm audit confirm no known vulnerabilities in used packages.

Planned Enhancements:

  • Encryption: Encrypting stored passwords within the configuration file

🐛 Troubleshooting

Encountering issues can be frustrating; here are some common problems and their potential fixes:

Service Manager Issues

  • The application relies on systemctl commands which require sudo privileges. If you are not logged in as root and encounter permission errors: Consider modifying your sudoers file to provide necessary permissions to your user.

Application Failures

  • Check Logs: Review the log files for clues: %APPDATA%/mavs-rc/logs/
  • Reset Application Data: If issues persist, try deleting the application data directory. You may want to back up important configurations such as rc-remotes.config.json_ beforehand: %APPDATA%/mavs-rc/

Build Issues

  • Update Node.js: Ensure your Node.js installation is up to date.
  • Verbose Output: Use npm run makeVerbose for more detailed build output.
  • Clean Project: If builds still fail:
    • Delete node_modules, package-lock.json, .vite, and out directories.
    • Reinstall dependencies with npm i.
    • Restarting your development environment, such as Visual Studio Code, may resolve file lock issues.

Further Assistance

  • If these steps do not resolve your problems, please open an issue on GitHub for developer support.

📚 Project structure

The project was initialy created using electron forge with the typescript vite template.

  • src/ contains the source code
    • main/ contains the main code of the electron app that has full access
    • renderer/ contains the js, css and html that runs in the browser/frontend. Has no permissions. Talks via IPC with the main part
    • shared/ contains code that is shared between main and renderer
  • out/ contains the executables and setup files after calling 'npm run build'

❤️ Credits

Mav's RC was built using a variety of cool open-source tools and libraries. Many thanks to the following projects and their contributors:

  • Electron: For enabling cross-platform desktop app capabilities.
  • Forge: Simplified the build process significantly.
  • React: For efficient UI development.
  • Vite: Enhanced the development workflow with its super fast build tool.
  • SSH2 and ssh2-promise: For SSH communication capabilities.
  • NextUI: Provided the elegant UI components.
  • XTerm: Enabled the integrated terminal functionality.
  • Monaco Editor: For the sophisticated text editing features.
  • TailwindCSS: For utility-first CSS management.
  • Custom Electron Prompt: For good looking prompts in electron

Custom Modifications

  • ssh2-promise: I downloaded the package and made some minor modifications: mostly strictly typing and changed from CommonJs to ES6. The modified code can be found under /mavs-rc/src/main/ssh2-promise

Visual Assets

  • Background Images/Gradient: those are from NextUI

⬇️ Screenshots

Connect Shell Shell Service Management Explorer File EditorSSH Tunnels System Info


📰 Changelog

Changes are tracked in the Changelog


📰 License

MIT