Using Linux to SSH and SCP Files Over to Your Hosting Account

Getting Started | Updated March 2026

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.

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:

  1. 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.

  2. Copy the public key to the server:
    ssh-copy-id username@yourdomain.com

    Enter your cPanel password when prompted. This copies your public key to ~/.ssh/authorized_keys on the server.

  3. Test the connection:
    ssh username@yourdomain.com

    You should connect without being asked for a password (you may be asked for your key passphrase if you set one).

Tip

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 Ticket

Quick Recap: Linux SSH and SCP

  1. Connect with SSH - ssh username@server for a remote shell
  2. Upload with SCP - scp file username@server:~/public_html/
  3. Download with SCP - scp username@server:~/file ./
  4. Set up SSH keys - ssh-copy-id for passwordless authentication
  5. Use an SSH config - Simplify connections with host aliases in ~/.ssh/config

Last updated March 2026 · Browse all Getting Started articles

  • 0 Users Found This Useful

Was this answer helpful?

Related Articles

Why can I not telnet into my server? What is SSH?

Article Updated This article has been consolidated Telnet and SSH information is now in...

Using Linux to FTPS, SFTP, or FTP Files Over to Your Hosting Account

Getting Started | Updated March 2026 If you're on a Linux desktop or server, you don't need a...

How to Migrate Your Website from Weebly

Getting Started | Updated April 2026 Weebly has been in maintenance mode since Square...

I am getting an error - Can you help troubleshoot it?

Article Updated Need Help With an Error? Search our knowledgebase for your specific error...

I tried to ssh to my new account and it said it was disabled

Article Updated This article has been consolidated SSH access details are now in our SSH...



Save 30% on web hosting - Use coupon code Hosting30