Yoast Canonical Pointing to Staging: Why No Setting Shows It
My Yoast canonical pointed at a dead staging site while every setting looked fine.…
In the world of WordPress development, efficiency and security are paramount. This is where SSH commands come into play.
Secure Shell (SSH) is a protocol that allows you to access and manage your WordPress site through the command line, providing a secure and powerful way to handle tasks such as troubleshooting, updating files, and managing your site without the need for the WordPress dashboard. For both beginners and seasoned developers, mastering SSH can significantly enhance your workflow and project management.
But what exactly is SSH? For those new to this concept, SSH, or Secure Shell, is a cryptographic network protocol that enables secure access to a computer over an unsecured network. It’s a tool used not only for accessing remote servers but also for executing commands and transferring data securely.
Get free WordPress & AI tips
Join 500+ readers. No spam, unsubscribe anytime.

Before diving into more complex SSH commands, understanding how to navigate your server’s file system is crucial. Use these basic commands:
pwd: Displays the current directory path. This SSH command is useful for always knowing your location in the server’s file system.ls: Lists files and directories in the current directory. You can use options like ls -lh to view file sizes in a human-readable format.cd: Changes the directory to the specified path, allowing you to navigate through different directories.Managing files and directories is a common task that SSH simplifies:
mkdir [directory_name]: Creates a new directory, essential for organizing your files.rmdir [directory_name]: Removes an empty directory. Use rm -r [directory_name] for non-empty directories, but be cautious with this powerful command.cp [destination]: Copies files or directories. The r option allows you to copy directories recursively.mv [destination]: Moves or renames files or directories. This command is particularly useful for organizing your file structure.Efficient file management often involves compression, which saves disk space and bandwidth:
zip [archive_name.zip] [file1] [file2]: Compresses files into a .zip archive.unzip [archive.zip]: Extracts files from a .zip archive.tar -czvf [archive_name.tar.gz] [directory]: Compresses a directory into a .tar.gz archive, ideal for backups.tar -xzvf [archive_name.tar.gz]: Decompresses a .tar.gz archive.Enhance your efficiency with these commands:
history: Displays a list of previously used SSH commands. This is helpful for repeating complex command sequences.clear: Clears the terminal screen for better readability, keeping your workspace organized.Understanding file sizes can help you manage your server’s storage effectively:
du -sh [directory]: Shows the total size of a directory, with the h option providing a human-readable format.df -h: Displays disk space usage of all mounted filesystems, helping you monitor server storage.For those ready to take their SSH skills to the next level, here are some advanced commands:
grep [pattern] [file]: Searches for a specific pattern within a file, useful for troubleshooting and debugging.find [directory] -name [filename]: Searches for files within a directory, a handy tool for locating misplaced files.rsync -avz [destination]: Synchronizes files and directories between two locations, often used for backups.Setting up SSH access might seem daunting, but with a little guidance, you can ensure secure and efficient connections.
ssh username@server-ipSSH keys provide an additional layer of security. To generate keys:
ssh-keygen in your terminal.~/.ssh/authorized_keys file.Securely configuring SSH access is crucial for protecting your WordPress server and enabling safe interactions. Here’s how to set it up:
Instead of using passwords, SSH keys provide a more secure way to access your server. Run the following command to generate a public-private key pair:
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
This will create two files:
To enable passwordless authentication, transfer your public key to your server using:
ssh-copy-id username@yourserver.com
Once this is done, you can log in securely without entering a password.
Once connected via SSH, you need to locate your WordPress installation.
cd /path/to/wordpresslsAlways back up essential files before making changes. For example, to back up your wp-config.php file:
bashCopy codecp wp-config.php wp-config-backup.php
File permissions help prevent unauthorized access. Set proper permissions for wp-config.php to enhance security:
bashCopy codechmod 640 wp-config.php
This restricts access, ensuring only the necessary system processes can read or modify the file.
When using SSH, beginners might encounter some common issues. Here are a few troubleshooting tips:
~/.ssh/known_hosts if server details have changed.Mastering SSH commands can revolutionize the way you manage your WordPress projects. By understanding and utilizing these commands, you can streamline your workflow, improve security, and handle troubleshooting with ease. Whether you’re a beginner or an experienced developer, integrating SSH into your toolkit is a game-changer.
What are SSH commands?
SSH commands allow you to securely access and manage your server and WordPress site via the command line, enabling efficient file management, troubleshooting, and more.
How do I access my WordPress server using SSH?
Using a terminal application on Mac/Linux or a tool like PuTTY on Windows, connect to your server with the command ssh username@hostname.
Why should I use SSH commands for WordPress?
SSH commands provide a secure, efficient way to manage your WordPress site, offering capabilities beyond what the dashboard can provide, especially for developers and technical users.