Accessing your web hosting account via SSH (Secure Shell) or SFTP (SSH File Transfer Protocol) allows you to manage website files, run command-line tools (like Composer, Git, or WP-CLI), and securely upload large website archives to your /public_html/ directory.
This guide will show you how to enable SSH access in DirectAdmin, connect via SFTP using FileZilla or Cyberduck, and log in to the command line using terminal commands or SSH keys.
Connection Credentials Overview
To connect via SSH or SFTP, use your main DirectAdmin account credentials:
- Host / Server:
yourdomain.com(or your server hostname, e.g.web.cubes.host) - Protocol: SFTP - SSH File Transfer Protocol
- Port:
22(or custom SSH port2222if specified in your welcome email) - Username: Your main DirectAdmin Username (e.g.
user123) - Password: Your DirectAdmin Account Password
Method 1: Connecting via SFTP (FileZilla, Cyberduck, or WinSCP)
SFTP encrypts all file transfers, making it far more secure than legacy plain-text FTP.
Using FileZilla:
- Open FileZilla on your computer.
- Go to File > Site Manager and click New Site.
- Set Protocol to SFTP - SSH File Transfer Protocol.
- Fill in your connection details:
- Host:
yourdomain.com(or server IP) - Port:
22 - Logon Type: Normal
- User: Your DirectAdmin Username
- Password: Your DirectAdmin Password
- Host:
- Click Connect.
- Once connected, open the
public_htmlfolder on the right-hand remote window. This is where your website's HTML, PHP, and WordPress files live!
Method 2: Connecting via SSH Terminal (Command Line)
SSH access allows developers to execute terminal commands directly on the server.
Connecting on macOS or Linux Terminal:
Open your terminal application and run:
ssh [email protected] -p 22
(Replace username with your DirectAdmin username and yourdomain.com with your domain).
Connecting on Windows (PowerShell or PuTTY):
- Windows Terminal / PowerShell: Type
ssh [email protected] -p 22and enter your password when prompted. - PuTTY: Enter
yourdomain.comin Host Name, set Port to22, set Connection Type to SSH, and click Open.
Method 3: Using SSH Key Authentication (Recommended for Security)
SSH keys eliminate the need to type your password when logging in, providing bank-grade security.
1. Generate or Paste an SSH Key in DirectAdmin
- Log in to your Cubes Hosting DirectAdmin Control Panel.
- Navigate to Advanced Features > SSH Keys (or Account Manager > SSH Keys).
- Click Paste Key to paste your local public key (
id_rsa.puborid_ed25519.pub). - Click Create or Authorize.
2. Connect Using Your Private Key
ssh -i ~/.ssh/id_rsa [email protected] -p 22
File Permission Best Practices
When uploading or modifying website files via SFTP or SSH, ensure proper file permissions to prevent web server 403 Forbidden or 500 Internal Server errors:
- Directories / Folders: Set permissions to
755(drwxr-xr-x). - Files (
.html,.php,.css): Set permissions to644(-rw-r--r--). - Web Root Location: Always upload your live site code into
/public_html/.
Conclusion
SSH and SFTP give you total developer control over your DirectAdmin web hosting account. Connect using SFTP Port 22 in FileZilla, authorize your SSH keys, and manage your website code securely!
