This error indicates that while the network path to the server exists, the server itself rejected the connection request. This guide provides a comprehensive approach to diagnosing and fixing this issue on your iDatam server, whether you are using a VPS, Dedicated Server, or a GPU-accelerated instance.
What You'll Learn
Common Causes of SSH Rejection
Checking SSH Service Status
Verifying Port and IP Configuration
Ensuring SSH Server Installation
Firewall and Security Group Setup
Auditing sshd_config Files
Testing Network Reachability
Common Causes of SSH Rejection
Why Connections Fail
Before running commands, it's important to understand why the server might be saying "No":
-
The SSH Service is Down: The background daemon (sshd) responsible for connections is not running.
-
Wrong Port: You are targeting Port 22, but the server has been configured to listen on a custom port.
-
Firewall Interference: UFW, iptables, or the iDatam Cloud Firewall is blocking the specific port.
-
Resource Exhaustion: The server is out of RAM or CPU, preventing it from spawning a new SSH process.
1. Check if the SSH Service is Active
If you cannot SSH in, use the iDatam Web Console in your dashboard to access the command line directly.
Check status:
Firewall Configuration
# Check status
sudo systemctl status ssh
# Note: Use 'sshd' for CentOS/RHEL
sudo systemctl status sshd
2. Verify Port and IP Configuration
A "Connection Refused" error often happens because you're knocking on the wrong door.
- Confirm IP: Ensure you aren't accidentally trying to connect to a different instance.
Check Listening Ports:
sudo netstat -tulpn | grep ssh
If your server uses a custom port (e.g., 2222), connect using the -p flag:
ssh -p 2222 user@your-server-ip
3. Ensure SSH Server is Installed
Check if the binary exists:
which sshd
If missing, install the server package:
Ubuntu/Debian:
sudo apt update && sudo apt install openssh-serverCentOS/RHEL:
sudo yum install openssh-server
4. Configure Your Firewalls
On the Server (UFW):
sudo ufw allow ssh
# OR if using a custom port
sudo ufw allow 2222/tcp
sudo ufw reload
iDatam Cloud Firewall: Check your iDatam control panel under "Security Groups". Ensure inbound TCP traffic is allowed on your SSH port for your specific IP or 0.0.0.0/0.
5. Audit the SSH Configuration File
Open the configuration:
sudo nano /etc/ssh/sshd_config
Verify these lines:
Port 22(Matches your connection attempt)ListenAddress 0.0.0.0(Listens on all interfaces)PermitRootLogin(Set to yes/prohibit-password depending on your needs)
Test and Restart:
sudo sshd -t && sudo systemctl restart ssh
6. Test Network Reachability
Diagnostic Commands:
# Check if server is online
ping your-server-ip
# Check if the port is "listening" externally
telnet your-server-ip 22
🛠 iDatam Support Pro-Tips
Use the VNC Console: If locked out by a firewall, use the web-based VNC console in the iDatam portal for emergency access.
IP Whitelisting: For GPU or Dedicated environments, whitelist only your specific Home/Office IP for enhanced security.
Check Logs: Run
tail -f /var/log/auth.log(Ubuntu) to see real-time rejection reasons.
Conclusion
The "SSH: Connection Refused" error is usually a simple configuration or service issue. By verifying the service status, checking port settings, and auditing your firewalls, you can quickly regain control of your server. If problems persist, iDatam's support experts are available 24/7 to assist.
Infrastructure Quick Comparison
| Feature | Dedicated Servers | GPU Cloud |
|---|---|---|
| Best For | Heavy Databases, ERP | AI/ML, Rendering |
| SSH Access | Full Root Access | Full Root Access |
| Scalability | High | Instant |
iDatam Recommended Tutorials
Linux
Solving the 5 Most Common Linux Server Problems
Master the art of Linux server problem solving with this comprehensive guide. Learn how to diagnose and fix common server issues including network problems, disk space management, security vulnerabilities, and performance bottlenecks.
Mysql
How To Create a New User and Grant Permissions in MySQL
Learn how to create a new MySQL user and grant permissions with this comprehensive guide. Understand the essential commands, best practices, and troubleshooting tips for effective user and permission management in MySQL.
Control Panel, Security
Plesk Server Security Tutorial: A Step-by-Step Guide to Secure Your Web Infrastructure
Secure your Plesk server with our in-depth tutorial! Learn step-by-step techniques, from updates and advanced configurations to code-level protections and emergency strategies, to fortify your web infrastructure against potential threats.
Discover iDatam Dedicated Server Locations
iDatam servers are available around the world, providing diverse options for hosting websites. Each region offers unique advantages, making it easier to choose a location that best suits your specific hosting needs.
