Access Console and SSH | Remote Connection Guide for VM Instances
Connect to your VM instances using browser-based console or SSH terminal for direct management and troubleshooting.
Console Access
Browser-Based Console
The Console provides a browser-based terminal connection to your VM instance without needing a local SSH client.
When to Use Console
- Quick troubleshooting without SSH setup
- Initial instance configuration
- Network troubleshooting
- System maintenance
- Security group changes preventing SSH
Opening Console
From VM Card
- Locate the VM instance in dashboard
- Scroll to bottom action buttons section
- Click the Console Button (Terminal icon)
- Console window opens in your browser
Console Window
- Full-screen terminal interface
- Black background with white text
- Cursor blinking ready for input
- Type commands to execute
Using Console
Basic Commands
# Check system information
uname -a
# View disk usage
df -h
# Check memory
free -m
# List processes
ps aux
# View system logs
tail -f /var/log/syslog
Console Features
- Full terminal access to instance
- Execute any command allowed by OS
- View output in real-time
- Copy/paste functionality
- Scroll through history
Common Console Tasks
- View system logs
- Check service status
- Manage users and permissions
- Install packages
- Update system configuration
- Restart services
Console Limitations
Limitations
- Requires instance to be running
- No file transfer capability
- Limited scroll-back history
- May have latency
- Some special characters not supported
Closing Console
Exit Console
- Type
exitand press Enter - Click X button on console window
- Click outside console area
- Press Escape key
Closing console doesn't affect your instance. It just disconnects your session.
SSH Access
Secure Shell Connection
SSH (Secure Shell) provides encrypted remote command-line access to your instance with full control and flexibility.
When to Use SSH
- Complex administration tasks
- Script execution
- File transfer with SCP
- Port forwarding
- Persistent long-running sessions
Prerequisites for SSH
Before connecting via SSH, you need:
Local SSH Client
- OpenSSH client (included on Linux/Mac)
- PuTTY (Windows alternative)
- VS Code Remote SSH extension
- Git Bash (Windows)
SSH Key Pair
- Private key file (keep secret)
- Public key on the instance
- Correct file permissions (600)
- Key must match instance's authorized keys
Network Access
- Port 22 (SSH) must be open
- Security group must allow inbound SSH
- Network connectivity to instance IP
- Instance must be running
Correct IP Address
- Public IP if connecting from internet
- Private IP if on same network
- Floating IP or elastic IP if configured
Getting SSH Connection Information
From VM Card
- Scroll to bottom of card
- Click the SSH Button (Terminal icon)
- Connection information displays
- Shows SSH command to use
- May show key file location
Connection String Format
ssh -i /path/to/key.pem ec2-user@instance-ip
Or for other operating systems:
ssh -i /path/to/key.pem ubuntu@instance-ip
ssh -i /path/to/key.pem admin@instance-ip
ssh -i /path/to/key.pem root@instance-ip
Information Provided
- Complete SSH command
- Private key file path
- Instance IP address
- Default username for OS
- Port number (usually 22)
Connecting via SSH
Using OpenSSH (Linux/Mac/Git Bash)
-
Open Terminal
# On Linux/Mac
open Terminal
# On Windows with Git Bash
right-click and "Git Bash Here" -
Copy SSH Command
- Copy the SSH command from dashboard
- Or manually construct:
ssh -i keyfile.pem user@ip-address
-
Execute Connection
ssh -i /path/to/key.pem [email protected] -
Accept Host Key (First Time)
- Message: "Are you sure you want to continue?"
- Type
yesand press Enter - Host key is added to known_hosts
-
Connected to Instance
- Prompt changes to instance name
- You're now remotely connected
- Execute commands directly
Using PuTTY (Windows)
-
Convert Private Key (if needed)
- PuTTYgen converts OpenSSH keys
- Load private key file
- Export as PuTTY format
-
Open PuTTY
- Launch PuTTY application
- Connection type: SSH
- Port: 22
-
Configure Connection
- Host Name: Instance IP address
- Username: default OS user
- Auth → Private key file: select .ppk file
-
Connect
- Click "Open"
- Accept host key if prompted
- You're connected and ready
SSH Commands
After Successful Connection
# View system information
uname -a
lsb_release -a
# Check disk space
df -h
# View memory
free -h
# List processes
ps aux | grep process-name
# View recent logs
tail -100 /var/log/syslog
# Check network connectivity
ping google.com
netstat -tulpn
# Restart a service
sudo systemctl restart service-name
# View running services
sudo systemctl list-units --type=service --state=running
# Edit a file
nano /path/to/file
# or
vi /path/to/file
File Transfer with SCP
Copying Files to Instance
# Single file
scp -i /path/to/key.pem /local/path/file.txt user@instance-ip:/remote/path/
# Entire directory
scp -r -i /path/to/key.pem /local/path/directory user@instance-ip:/remote/path/
Copying Files from Instance
# Single file
scp -i /path/to/key.pem user@instance-ip:/remote/path/file.txt /local/path/
# Entire directory
scp -r -i /path/to/key.pem user@instance-ip:/remote/path/directory /local/path/
Disconnecting SSH
End SSH Session
# Type exit command
exit
# Or press Ctrl+D
The terminal closes and you're back on your local machine.
Key Management
SSH Key Pair Setup
Creating New Key Pair (if needed)
# Generate new key
ssh-keygen -t rsa -b 4096 -f ~/.ssh/my-instance-key
# You'll be prompted for:
# - Passphrase (optional but recommended)
# - Confirm passphrase
# View your public key
cat ~/.ssh/my-instance-key.pub
Adding Public Key to Instance
If key isn't already on instance:
- Generate key pair (above)
- Copy public key to instance:
ssh-copy-id -i ~/.ssh/my-instance-key.pub user@instance-ip - Or manually add to
~/.ssh/authorized_keys
Key Permissions
Correct Permissions Required
# Private key (your computer)
chmod 600 ~/.ssh/my-instance-key
# SSH directory
chmod 700 ~/.ssh
# Authorized keys on instance
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
Permission Errors
- "Permission denied" usually means wrong permissions
- Run chmod commands above to fix
- Common issue with newly created keys
Key Security
Never share your private key with anyone.
Protecting Private Keys
- Store in secure location (~/.ssh/)
- Don't commit to version control
- Don't email or upload
- Use passphrase for extra protection
- Regularly rotate keys
- Delete old unused keys
Troubleshooting Connection Issues
Cannot Connect to Instance
Check Prerequisites
- Is instance running? Check status in dashboard
- Do you have the correct IP address?
- Do you have the correct private key?
- Is the private key in correct location?
- Are file permissions correct?
Common Errors
"Permission denied (publickey)"
- Private key doesn't match public key
- Public key not added to instance
- Wrong key file specified
- File permissions wrong (should be 600)
- Wrong username for OS
Solution:
# Verify key permissions
ls -la ~/.ssh/my-key.pem
# Should show: -rw------- (600)
# Re-add public key to instance
ssh-copy-id -i ~/.ssh/my-key.pem user@instance-ip
"Connection refused"
- SSH service not running on instance
- Port 22 not open in security group
- Wrong port specified
- Instance is stopping/starting
Solution:
- Check security group allows port 22
- Restart SSH service if you have console access
- Wait if instance is starting up
- Verify correct IP address
"Connection timeout"
- Network connectivity issue
- Security group blocking traffic
- Instance is down or unreachable
- IP address incorrect
Solution:
- Check instance status in dashboard
- Verify security group rules
- Check your network firewall
- Use console to troubleshoot
- Verify correct IP address
"Host key verification failed"
- First time connecting to new instance
- Host key not in known_hosts file
- Host key changed
Solution:
- Type
yeswhen prompted - Host key will be saved
- Future connections won't prompt
SSH Key Issues
"Permission denied" with correct key
-
Verify correct private key:
ssh-keygen -l -f ~/.ssh/key.pem -
Verify public key on instance:
cat ~/.ssh/authorized_keys -
Add public key if missing:
ssh-copy-id -i ~/.ssh/key.pem user@instance-ip
Lost Private Key
- If key is lost, you can't connect
- Use console access instead
- Request new instance if needed
- Generate new key pair for future instances
Network Issues
Cannot Reach Instance IP
- Check instance has public IP (if needed)
- Verify security group allows SSH (port 22)
- Check your firewall isn't blocking
- Test from another network if possible
- Use instance console to troubleshoot
Latency or Slow Connection
- Check network conditions
- Try different network (if possible)
- Reduce screen size if high latency
- Use SCP with -C flag for compression
- Restart instance if very slow
Security Best Practices
-
Protect Private Keys
- Never share with others
- Use strong passphrases
- Store securely
- Regular backups
-
Use SSH Keys Instead of Passwords
- More secure than passwords
- Can't brute-force SSH keys
- Required for automation
-
Regular Key Rotation
- Create new keys periodically
- Remove old unused keys
- Maintain audit trail
-
SSH Configuration
- Disable password authentication
- Change SSH port (optional)
- Use fail2ban for bruteforce protection
- Restrict SSH to specific IPs if possible
-
Monitoring
- Monitor SSH logs for failed attempts
- Alert on successful connections from new IPs
- Review authorized_keys regularly
Advanced SSH Features
SSH Config File
Create ~/.ssh/config
Host my-instance
HostName 54.123.45.67
User ec2-user
IdentityFile ~/.ssh/my-key.pem
StrictHostKeyChecking accept-new
UserKnownHostsFile ~/.ssh/known_hosts
Connect using alias:
ssh my-instance
Port Forwarding
Local Port Forwarding
# Access remote database locally
ssh -i key.pem -L 3306:localhost:3306 user@instance-ip
Remote Port Forwarding
# Make local service accessible to instance
ssh -i key.pem -R 8080:localhost:8080 user@instance-ip
SFTP for File Management
# Interactive file transfer
sftp -i key.pem user@instance-ip
# Commands available:
# get file.txt - download
# put file.txt - upload
# ls - list files
# cd path - change directory
# exit - quit
Next Steps
- Managing VMs - Perform operations on instances
- VM Instance Details - View complete information
- Monitoring Performance - Track metrics