Skip to main content
VPS NEPALby NepalCloud Host
PricingAbout
Client area Explore VPS plans
View VPS plansCompare pricing
VPS hosting
All VPS plansSmall VPS · from NPR 2,999/yearUbuntu VPSWindows VPSOperating systems
Solutions
Application hostingn8n automationDatabase VPSDevelopment VPSWeb hostingDomainsDedicated servers
Resources
DocumentationConnect over SSHGuides & articlesFAQsSupportContact
About VPS NepalContact supportOpen client area
Documentation

Connect via SSH

Learn how to securely connect to your VPS using SSH. Complete guide to key authentication, configuration, and troubleshooting.

Prerequisites
  • Active VPS with SSH service running
  • SSH client installed on your local machine
  • VPS IP address or domain name
  • Valid username and password or SSH keys
SSH Basics

SSH (Secure Shell) is the standard protocol for securely connecting to remote servers. It provides encrypted communication and authentication between your local machine and the VPS.

Why SSH?

  • Encrypted connection prevents eavesdropping
  • Secure authentication methods
  • Works on all major operating systems
  • Supports file transfers and tunneling
# Check if SSH is installed
ssh -V

# On Windows, you might need to use:
# PowerShell: Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'
# Or install OpenSSH client from Microsoft Store
Password Authentication

The simplest way to connect is using password authentication. This method requires you to enter your VPS password each time you connect.

Basic Connection:

  • Replace your-username with your actual username
  • Replace your-server-ip with your VPS IP address
  • You'll be prompted for your password
# Basic SSH connection with password
ssh your-username@your-server-ip

# Specify a different port (if not using default 22)
ssh -p 2222 your-username@your-server-ip

# Connect with verbose output (for troubleshooting)
ssh -v your-username@your-server-ip
SSH Key Authentication

SSH key authentication is more secure than passwords and allows for passwordless login. This is the recommended method for production servers.

Key Benefits:

  • No passwords to remember or type
  • More secure than password authentication
  • Supports automation and scripts
  • Keys can be password-protected for extra security
# Generate SSH key pair (on your local machine)
ssh-keygen -t rsa -b 4096 -C "your-email@example.com"

# Press Enter for default location
# Optional: Add a passphrase for extra security

# Copy public key to your server
ssh-copy-id your-username@your-server-ip

# Alternative method - manual copy
cat ~/.ssh/id_rsa.pub
# Copy the output and paste it to ~/.ssh/authorized_keys on server
SSH Configuration

You can customize SSH behavior using configuration files. This allows you to set default options, aliases, and security settings.

Configuration Files:

  • ~/.ssh/config - User-specific configuration
  • /etc/ssh/sshd_config - Server configuration
  • ~/.ssh/known_hosts - Known host keys
# Create SSH config file
nano ~/.ssh/config

# Add server configuration
Host myserver
    HostName your-server-ip
    User your-username
    Port 22
    IdentityFile ~/.ssh/id_rsa

# Now you can connect with:
ssh myserver

# Server-side security (run on your VPS)
sudo nano /etc/ssh/sshd_config

# Recommended security settings:
# Port 22 (change to custom port)
# PermitRootLogin no
# PasswordAuthentication no
# PubkeyAuthentication yes
# MaxAuthTries 3

sudo systemctl reload sshd
Advanced SSH Features

SSH offers many advanced features for power users and administrators. These features can improve productivity and security.

Useful Features:

  • Port forwarding - Tunnel traffic through SSH
  • SCP/SFTP - Secure file transfers
  • SSH agent - Manage multiple keys
  • X11 forwarding - Run GUI applications remotely
# Port forwarding examples
# Local port forwarding (access remote service locally)
ssh -L 8080:localhost:80 your-username@your-server-ip

# Remote port forwarding (expose local service remotely)
ssh -R 8080:localhost:3000 your-username@your-server-ip

# File transfer with SCP
scp file.txt your-username@your-server-ip:/path/to/destination/
scp your-username@your-server-ip:/path/to/file ./local/destination/

# SFTP for interactive file transfer
sftp your-username@your-server-ip

# SSH agent for managing keys
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa

# Run command remotely without interactive shell
ssh your-username@your-server-ip "sudo apt update && sudo apt upgrade -y"
Troubleshooting SSH

Common SSH connection issues and their solutions. Most problems can be resolved with these troubleshooting steps.

Common Issues:

  • Connection refused or timeout
  • Permission denied errors
  • Host key verification failed
  • Port already in use
# Check SSH service status on server
sudo systemctl status sshd
sudo systemctl enable sshd
sudo systemctl start sshd

# Test connection with verbose output
ssh -v your-username@your-server-ip

# Clear known hosts (if host key changed)
ssh-keygen -R your-server-ip

# Check firewall settings
sudo ufw status
sudo ufw allow ssh

# Check SSH port
sudo netstat -tlnp | grep :22
sudo ss -tlnp | grep :22

# Test from another location (to rule out network issues)
ssh -T your-username@your-server-ip
Contents
SSH BasicsPassword AuthenticationSSH Key AuthenticationSSH ConfigurationAdvanced SSH FeaturesTroubleshooting SSH
Related Docs

Install Applications

Install and configure applications on your VPS

Firewall Setup

Configure firewall rules to secure your SSH connection

System Updates

Keep your SSH server and client software updated

Need Help?

Can't find what you're looking for? Our support team is here to help.

VPS NEPAL

Clear VPS pricing, capable infrastructure and practical support for people building on the web in Nepal.

A service by NepalCloud Host PVT. LTD.

support@nepalcloud.host Kathmandu, Nepal

Hosting

  • VPS hosting plans
  • Small VPS
  • Windows VPS
  • Ubuntu VPS
  • Web hosting
  • Domain registration

Resources

  • Documentation
  • Guides & articles
  • Support centre
  • Frequently asked questions
  • Contact

Legal

  • Privacy Policy
  • Terms of Service
  • Acceptable Use Policy
  • Fair Use Policy
  • Refund Policy

© 2026 NepalCloud Host PVT. LTD. All rights reserved.

Client portal