SSH Remote Development Setup
Remote Development Server Setup with Frappe MCP Integration
Overview
This guide covers setting up VS Code remote development on SSD nodes with SSH key authentication, plus integration with Frappe MCP for seamless ERPNext development at Hybrowlabs.
Prerequisites
- VS Code installed on your local machine
- Remote SSH extension for VS Code
- SSH access to Hybrowlabs SSD nodes
- Node.js installed (for Frappe MCP)
- Access to https://operate.hybrowlabs.com
- Frappe API credentials
Part 1: SSH Key Authentication Setup
Step 0: Generate SSH Key Pair (if you don't have one)
On Windows (using PowerShell or Git Bash)
# Generate SSH key pair
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
# Press Enter to accept default file location (~/.ssh/id_rsa)
# Enter a secure passphrase when prompted
On macOS/Linux
# Generate SSH key pair
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
# Press Enter to accept default file location (~/.ssh/id_rsa)
# Enter a secure passphrase when prompted
Step 0.1: Copy Public Key to SSD Nodes
Method 1: Using ssh-copy-id (Linux/macOS)
# Copy your public key to the SSD node
ssh-copy-id username@ssd_node_ip_address
# Enter your current password when prompted
Method 2: Manual Copy (All platforms)
# Display your public key
cat ~/.ssh/id_rsa.pub
# Copy the output, then SSH into your SSD node with password
ssh username@ssd_node_ip_address
# On the SSD node, create .ssh directory if it doesn't exist
mkdir -p ~/.ssh
chmod 700 ~/.ssh
# Add your public key to authorized_keys
echo "paste_your_public_key_here" >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
# Exit the SSH session
exit
Method 3: Using PowerShell (Windows)
# Read your public key
Get-Content $env:USERPROFILE\.ssh\id_rsa.pub | Set-Clipboard
# SSH into your SSD node
ssh username@ssd_node_ip_address
# Follow the same steps as Method 2 on the remote node
Step 0.2: Test SSH Key Authentication
# Test connection without password
ssh username@ssd_node_ip_address
# You should now connect without entering a password
# (only SSH key passphrase if you set one)
Step 0.3: Disable Password Authentication (Optional - Security Hardening)
# SSH into your SSD node
ssh username@ssd_node_ip_address
# Edit SSH configuration (requires sudo)
sudo nano /etc/ssh/sshd_config
# Find and modify these lines:
# PasswordAuthentication no
# PubkeyAuthentication yes
# AuthorizedKeysFile .ssh/authorized_keys
# Restart SSH service
sudo systemctl restart sshd
# Exit and test connection again
exit
ssh username@ssd_node_ip_address
Step 1: Install Required Extensions
- Open VS Code
- Go to Extensions (Ctrl+Shift+X or Cmd+Shift+X)
- Search for "Remote - SSH"
- Install the "Remote - SSH" extension by Microsoft
Step 2: Connect to Remote Host
Method 1: Using Remote Explorer
- Click the Remote Explorer icon in the Activity Bar (left sidebar)
- Click the "+" icon next to "SSH Targets"
- Enter your SSH command:
ssh username@ip_address - Choose where to save the configuration (usually the first option)
Method 2: Using Command Palette
- Press Ctrl+Shift+P (or Cmd+Shift+P on Mac)
- Type "Remote-SSH: Connect to Host"
- Select "Add New SSH Host"
- Enter your SSH command:
ssh username@ip_address - Select configuration file location
Step 3: Configure SSH Connection with Key Authentication
- After adding the host, VS Code will create/update your SSH config file
- Open the config file to customize settings for SSD nodes:
Host ssd-node-1 HostName ssd_node_ip_address User your_username Port 22 IdentityFile ~/.ssh/id_rsa PreferredAuthentications publickey PasswordAuthentication no # Example for multiple SSD nodes Host ssd-node-2 HostName another_ssd_node_ip User your_username Port 22 IdentityFile ~/.ssh/id_rsa PreferredAuthentications publickey PasswordAuthentication no - Save the configuration file
SSH Config Options Explained
IdentityFile: Path to your private SSH keyPreferredAuthentications: Forces public key authenticationPasswordAuthentication no: Disables password fallbackServerAliveInterval 60: Keeps connection alive (optional)ServerAliveCountMax 3: Connection timeout settings (optional)
Step 4: Connect to the Remote Server
- In Remote Explorer, find your configured host
- Click the connection icon next to your host
- Choose "Connect to Host in Current Window" or "Connect to Host in New Window"
- Enter your password or SSH key passphrase when prompted
- Wait for VS Code Server to install on the remote machine
Step 5: Open Remote Directory
- Once connected, click "Open Folder" or press Ctrl+K Ctrl+O
- Navigate to your desired directory (e.g.,
/home/usernameor/var/www) - Click "OK" to open the folder
- Trust the workspace when prompted
Step 6: Set Up Your Development Environment
Install Extensions on Remote
- Go to Extensions (Ctrl+Shift+X)
- Install any needed extensions (they'll install on the remote server)
- Common extensions: language support, linters, formatters
Open Terminal
- Press Ctrl+Shift+` or go to Terminal → New Terminal
- This opens a terminal session on the remote machine
- Install any required tools (Node.js, Python, etc.)
Step 7: Port Forwarding for Web Development
Forward Ports Automatically
- Go to the "Ports" tab in the terminal panel
- Click "Forward a Port"
- Enter the port number (e.g., 3000 for Express apps)
- VS Code will automatically forward remote port to localhost
Access Your Application
- Open browser and go to
localhost:port_number - Your remote application will be accessible locally
Step 8: Development Workflow
File Operations
- Edit files directly in VS Code
- Changes are saved to the remote server
- Use Git normally (if installed on remote)
Running Applications
# Example: Start a Node.js application
npm install
npm start
# Example: Start a Python application
python app.py
# Example: Start with process manager
pm2 start app.js
Debugging
- Set breakpoints in your code
- Go to Run and Debug (Ctrl+Shift+D)
- Configure launch.json if needed
- Start debugging - works exactly like local debugging
Step 9: Advanced Configuration
Create Tasks (Optional)
- Create
.vscode/tasks.jsonin your project:{ "version": "2.0.0", "tasks": [ { "label": "start-app", "type": "shell", "command": "npm start", "group": "build" } ] }
Install Task Extensions
- Search for "Tasks" extensions to add task buttons to status bar
- Install on remote server for easy task management
Troubleshooting SSH Key Issues
Common SSH Key Problems
"Permission denied (publickey)":
# Check SSH key permissions chmod 600 ~/.ssh/id_rsa chmod 644 ~/.ssh/id_rsa.pub chmod 700 ~/.ssh # On SSD node, check authorized_keys permissions chmod 600 ~/.ssh/authorized_keys chmod 700 ~/.sshSSH agent not running:
# Start SSH agent (Linux/macOS) eval "$(ssh-agent -s)" ssh-add ~/.ssh/id_rsa # On Windows (PowerShell) Start-Service ssh-agent ssh-add $env:USERPROFILE\.ssh\id_rsaWrong key format:
# Convert OpenSSH key to PEM format if needed ssh-keygen -p -m PEM -f ~/.ssh/id_rsaMultiple keys:
# Test specific key ssh -i ~/.ssh/id_rsa username@ssd_node_ip # Add specific key to SSH agent ssh-add ~/.ssh/specific_key
SSD Node Specific Considerations
- High-performance storage: Take advantage of fast I/O for large file operations
- Resource monitoring: Use
htop,iotopto monitor node performance - Concurrent connections: SSD nodes often support multiple simultaneous connections
- Backup considerations: Ensure your SSH keys are backed up securely
SSH Key Management for Multiple SSD Nodes
# Create node-specific keys (optional)
ssh-keygen -t rsa -b 4096 -f ~/.ssh/ssd_node_key -C "ssd-nodes-access"
# Add to SSH config for specific nodes
Host ssd-cluster-*
IdentityFile ~/.ssh/ssd_node_key
User cluster_user
Port 22
Security Best Practices for SSD Nodes
Use strong SSH keys: Minimum 4096-bit RSA or Ed25519 keys
# Generate Ed25519 key (more secure, faster) ssh-keygen -t ed25519 -C "your_email@example.com"Protect your private keys:
# Set strict permissions chmod 600 ~/.ssh/id_rsa chmod 600 ~/.ssh/id_ed25519 # Use strong passphrases ssh-keygen -p -f ~/.ssh/id_rsa # Change passphraseSSH Hardening on SSD Nodes:
# Edit /etc/ssh/sshd_config on the SSD node sudo nano /etc/ssh/sshd_config # Recommended settings: # Port 2222 # Use non-standard port # PermitRootLogin no # Disable root login # MaxAuthTries 3 # Limit authentication attempts # ClientAliveInterval 300 # Timeout idle connections # ClientAliveCountMax 2 # Maximum timeouts # AllowUsers your_username # Restrict allowed usersUse SSH config with security options:
Host ssd-nodes-* HostName %h.your-domain.com User your_username Port 2222 IdentityFile ~/.ssh/ssd_node_key PreferredAuthentications publickey PasswordAuthentication no HashKnownHosts yes VisualHostKey yes ServerAliveInterval 60 ServerAliveCountMax 3Key rotation: Regularly rotate SSH keys (quarterly/annually)
- Monitor access: Use tools like
last,who,wto monitor connections - Backup keys securely: Store backup copies in encrypted storage
Next Steps
For Hybrowlabs Development Team:
- Set up your development environment following this guide
- Configure Frappe MCP for operate.hybrowlabs.com integration
- Test ERPNext development workflow with remote debugging
- Set up automated deployment for your custom apps
- Configure team collaboration through shared SSD node access