directadmin

DirectAdmin SSH Access – Enabling and Using It

Enabling and using SSH access on a DirectAdmin account - generating keys, connecting, common command-line tasks, and security considerations.

5 min read

DirectAdmin’s web interface handles most day-to-day tasks, but for backups, batch file operations, WP-CLI, log analysis, or anything scriptable, SSH access is faster. Some DirectAdmin plans expose SSH by default; others require enabling it. This guide covers enabling SSH on DirectAdmin, key-based authentication, and the command-line operations you’ll actually use.

Whether SSH is available on your plan

Log into DirectAdmin → User Level. Look for one of:

  • SSH Keys icon in Advanced Features or Account Manager section — SSH is available.
  • No SSH-related option — SSH disabled on your plan/server.

If you don’t see SSH options but need them, open a ticket. Some plans require manual enablement; others (like the most restrictive shared plans) don’t include SSH at all.

Connection details

  • Host: Your server hostname (e.g. server.iwebvault.com) or IP.
  • Port: Often 22, sometimes a custom port like 2222 — check support docs or ticket us.
  • Username: Your DirectAdmin username.
  • Password: Same as your DirectAdmin password initially. Switch to keys ASAP.

Setting up SSH key authentication

Password authentication works but keys are dramatically more secure. See SSH key guide for the general background.

Option A: Generate on the server via DirectAdmin

  1. DirectAdmin → SSH Keys.
  2. Create.
  3. Pick name, key size (4096 RSA or ed25519).
  4. Optional passphrase (recommended).
  5. Generate.
  6. Download the private key file — DirectAdmin only shows it once.
  7. The matching public key is automatically added to your authorized_keys.

Store the private key safely — your local machine, password manager, etc.

Option B: Generate locally, import public key

Generate on your local machine:

ssh-keygen -t ed25519 -C "your-email@example.com"

Open ~/.ssh/id_ed25519.pub, copy contents. In DirectAdmin → SSH Keys → Import → paste public key.

Private key stays on your machine; only the public key goes to the server.

Connecting via SSH

From your terminal:

# Basic password connection (replace with your details)
ssh username@server.iwebvault.com -p 22

# With key file
ssh -i ~/.ssh/yourkeyfile username@server.iwebvault.com -p 22

# Custom port
ssh username@server.iwebvault.com -p 2222

First connection shows a host fingerprint warning — type yes to confirm. Future connections skip this.

Once connected you’re in your home directory with the username’s shell.

Useful SSH commands for DirectAdmin users

pwd                       # current directory
ls -la                    # list files including hidden
cd domains/yourdomain.com/public_html   # change directory
cd ~                      # back to home
cd -                      # back to previous directory

Find big files / space hogs

# Top folders by size
du -sh ~/* | sort -hr | head -20

# Files over 100 MB
find ~ -type f -size +100M -exec ls -lh {} ;

# Files modified in last 7 days
find ~ -type f -mtime -7

Search inside files

# Find text inside files
grep -r "search-text" ~/domains/yourdomain.com/public_html/

# Find files by name pattern
find ~ -name "*.bak"

# Combined - find errors in error_log files
find ~ -name "error_log" -exec tail -20 {} ;

Edit files

nano filename.txt         # easier editor
vim filename.txt          # powerful editor with learning curve

Nano basics: edit text, Ctrl+O to save, Ctrl+X to exit.

Transfer files

# Download file from server to your machine (run on YOUR machine)
scp -P 22 username@server.iwebvault.com:/home/username/file.zip ~/Downloads/

# Upload file (run on YOUR machine)
scp -P 22 ~/Documents/file.zip username@server.iwebvault.com:/home/username/

# Sync entire folder
rsync -avz ~/local-folder/ username@server.iwebvault.com:~/remote-folder/

Archive operations

# Create a tarball
tar -czf backup-$(date +%F).tar.gz domains/yourdomain.com/public_html/

# Extract a tarball
tar -xzf backup.tar.gz

# Zip
zip -r site-backup.zip domains/yourdomain.com/public_html/

Process info

top                       # live process viewer (q to quit)
ps aux | grep php         # find PHP processes
df -h                     # disk usage by mountpoint
free -h                   # memory usage

WP-CLI on DirectAdmin

WP-CLI is the command-line WordPress tool. Install if not present:

cd ~
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
mv wp-cli.phar bin/wp     # or just keep as wp-cli.phar and use directly

# Test
./wp-cli.phar --version

Common uses:

cd ~/domains/yourdomain.com/public_html
wp core update
wp plugin update --all
wp search-replace 'http://oldurl' 'https://newurl' --dry-run
wp user reset-password admin
wp db export backup.sql

Security best practices

  • Use keys, not passwords. Disable password authentication via DirectAdmin once keys work.
  • Use a passphrase on your private key. Loss of laptop doesn’t immediately compromise server access.
  • Don’t share private keys. Each person/role should have their own key.
  • Use SSH agent / 1Password / etc. to manage keys conveniently.
  • Log out when done. Type exit or close terminal.
  • Don’t run as root. DirectAdmin users have their own user — that’s the level you should operate at.

Common questions

“Connection refused.” SSH not enabled on plan, wrong port, or firewall blocking your IP. Ticket support if first two checks fail.

“Permission denied (publickey).” Key not added correctly, wrong key file, or wrong permissions on key file (must be 600). chmod 600 ~/.ssh/yourkey.

“My shell looks limited / many commands missing.” Some restricted DirectAdmin plans use jailed shells (rbash or rssh) limiting available commands. Open a ticket to discuss unrestricted access if needed.

“Can I install packages via apt/yum?” No — that requires root. Your home directory only.

“How do I run scheduled tasks?” Cron jobs — set via DirectAdmin → Cron Jobs panel or via SSH with crontab -e. See DirectAdmin cron guide.

“Locked out after disabling password auth and losing key.” Open a support ticket — we can restore access via root.

What’s next

SSH unlocks the parts of hosting the web interface doesn’t reach — fast batch operations, log analysis, WP-CLI, custom scripts. The learning curve is real but the payoff is permanent productivity. Once you’re comfortable with the basics here, return to your web interface for what it does well; reach for SSH for what it doesn’t.

Was this helpful?