SSH and SCP are the most direct ways to manage your hosting account from a Linux machine. SSH gives you a command-line shell on your hosting server, while SCP lets you copy files securely between your local machine and the server. Both are built into every Linux distribution and use encryption for all traffic.
SSH: ssh username@yourdomain.com
Upload: scp file.zip username@yourdomain.com:~/public_html/
Download: scp username@yourdomain.com:~/public_html/file.zip ./
Replace username with your cPanel username. SSH access must be enabled on your account.
01. Connecting via SSH
# Basic connection
ssh username@yourdomain.com
# Connect to a specific server (if domain uses Cloudflare/proxy)
ssh username@web150.ultrawebhosting.com
# Connect on a specific port (default is 22)
ssh -p 22 username@yourdomain.com
The first time you connect to a server, you'll see a fingerprint verification prompt. Type yes to accept and save the server's key. Subsequent connections won't ask again unless the server's key changes.
Once connected, you're in your home directory (/home/username/). Your website files are in public_html/.
02. Uploading Files with SCP
# Upload a single file
scp myfile.html username@server:~/public_html/
# Upload to a specific subdirectory
scp image.png username@server:~/public_html/images/
# Upload multiple files
scp file1.html file2.html file3.css username@server:~/public_html/
# Upload an entire directory recursively
scp -r mysite/ username@server:~/public_html/
# Upload with compression (faster for text files over slow connections)
scp -C largefile.sql username@server:~/
03. Downloading Files with SCP
# Download a single file to current directory
scp username@server:~/public_html/wp-config.php ./
# Download to a specific local path
scp username@server:~/public_html/wp-config.php /tmp/backup/
# Download an entire directory
scp -r username@server:~/public_html/ ./site-backup/
# Download a database dump
scp username@server:~/backup.sql.gz ./
04. Using SSH Keys (Passwordless Login)
SSH key authentication is more secure than passwords and lets you connect without typing a password each time:
- Generate a key pair (if you don't already have one):
ssh-keygen -t ed25519 -C "your@email.com"Press Enter to accept the default file location. Set a passphrase for extra security or leave it empty.
- Copy the public key to the server:
ssh-copy-id username@yourdomain.comEnter your cPanel password when prompted. This copies your public key to
~/.ssh/authorized_keyson the server. - Test the connection:
ssh username@yourdomain.comYou should connect without being asked for a password (you may be asked for your key passphrase if you set one).
Add an SSH config entry to simplify connections further. Create or edit ~/.ssh/config:
Host mysite
HostName web150.ultrawebhosting.com
User username
IdentityFile ~/.ssh/id_ed25519
Then connect with just: ssh mysite or scp file.txt mysite:~/public_html/
05. Common SSH Tasks
Check Disk Usage
du -sh ~/public_html/
du -sh ~/public_html/*/ | sort -rh | head -10
Find Large Files
find ~/public_html/ -type f -size +50M -exec ls -lh {} \;
Compress a Directory for Download
tar czf ~/backup.tar.gz ~/public_html/
scp username@server:~/backup.tar.gz ./
Extract an Upload
cd ~/public_html/
unzip uploaded-theme.zip
# Or for tar.gz
tar xzf uploaded-files.tar.gz
Edit a File
nano ~/public_html/wp-config.php
# Or
vi ~/public_html/.htaccess
For more details on SSH access and available commands, see our comprehensive SSH access guide. For FTP-based transfers from Linux, see our Linux FTP/SFTP guide.
Need SSH Access Enabled?
SSH access may not be enabled by default on your hosting account. If you get "connection refused" on port 22, open a support ticket and we'll enable shell access.
Open a Support TicketQuick Recap: Linux SSH and SCP
- Connect with SSH -
ssh username@serverfor a remote shell - Upload with SCP -
scp file username@server:~/public_html/ - Download with SCP -
scp username@server:~/file ./ - Set up SSH keys -
ssh-copy-idfor passwordless authentication - Use an SSH config - Simplify connections with host aliases in ~/.ssh/config
Last updated March 2026 · Browse all Getting Started articles
