SSH, (or Secure Shell), is a cryptographic network protocol used to secure network connections over an unsecured network. To use SSH, you must use an SSH client to connect to the server. Once connected, you can manually run commands within a terminal application.
All connections within your SSH client travel over a secured connection, rather than plain text. Because of this, the connection is encrypted and secure.
SSH versions at DreamHost
Servers running Ubuntu 18 (Bionic) run SSH version 7.6p1. Servers running Ubuntu 14 (Trusty) run version 6.6.1p1.
Difference between SSH and FTP
FTP uses an FTP client (such as Filezilla) to connect to the server. This client is a visual client in that you can see directories and files on your local computer and the server as icons. You can then click on these icons to interact as needed. For example:
One of the biggest drawbacks about FTP is that you cannot run specific commands to accomplish a specific task. With FTP, you can upload/download files and directories. You can rename them as well, but you cannot run a command that 'does' anything.
With SSH, you use a terminal (or Shell) client to connect to the server. There are no visual depictions of data within the Shell. Everything is command line text. For example, this command checks the nameservers for dreamhost.com:
[server]$ dig ns +short dreamhost.com ns1.dreamhost.com ns2.dreamhost.com ns3.dreamhost.com
In this environment, you can type in commands to run specific tasks or tools, which is not possible with FTP. For example:
These tools can make it much easier to troubleshoot and manage your website. However, SSH can be difficult to use for new users, so some knowledge of the UNIX Shell is highly recommended.
Should I use SSH or FTP?
SSH can do everything FTP can, however it's more difficult to use and isn't recommended for beginners. If you're making simple adjustments to your website such as uploading/download files, FTP is the easier choice.
If you need to run specific commands, SSH is needed.
How to use SSH
Step 1 — Enabling Shell access
Before you are able to log into your server via SSH, you must change your website user to a SHELL user in the panel. This process is detailed in the following 'Enabling Shell Access' article:
This Shell user is the username you use to log into your server as shown below.
Step 2 — Opening up a terminal application
A terminal is a program you use to type Shell commands. There are several terminal clients (applications) you can use on any operating system. View the following article for the easiest options for Windows, Mac, and Linux:
Once you have chosen a terminal, open it to view a blank screen. Here you can enter a command to log into your server.
Step 3 — Locating your hostname
When you're ready to log into your server via SSH, you'll need to know your hostname. This can differ depending on which type of server you're site is on. View the 'Finding your server name' article for details on how to obtain the correct name.
The table below can also be used to locate your hostname.
|example.com||You can use this if you're logging into a specific website. Just change 'example.com' to your actual domain name. Your site must be hosted at DreamHost for this to work.|
|server.dreamhost.com||'server' is the name of your Shared server|
|ps123456.dreamhostps.com||'ps123456' is the name of your VPS server|
|ds123456.dreamservers.com||'ds123456' is the name of your Dedicated server|
|dp-ab12cd34ef.dreamhostps.com||'dp-ab12cd34ef' is the name of your DreamPress instance|
This article uses server.dreamhost.com as a general example. Make sure to use the correct server name for your particular site or server.
Step 4 — Logging into your server
To log in, type in 'ssh', followed by your Shell username, an @ sign, then your server name. For example:
[server]$ ssh email@example.com
[server]$ ssh firstname.lastname@example.org
Be sure to change example.com to your actual domain, or server.dreamhost.com to the server you're connecting to.
You are then asked for your Shell user's password. Enter this and you'll be logged in.
How to configure passwordless login
Once you set up a shell user, you must enter your password each time when logging into the server. If you’d like to avoid entering your password each time, you can set up Passwordless Login. This way, you'll be able to automatically log in each time without needing to enter your password.
How to configure passwordless login in Mac OS X and Linux
View the following article for instructions on how to enable this in OS X and Linux:
How to configure passwordless login in Windows
If you're using Windows, you'll need to download a third-party program named PuTTY to emulate a shell environment. View the following articles for further details:
- Creating a user with Shell (SSH) access
- SSH client software
- Troubleshooting SSH
- How to configure passwordless login in Mac OS X and Linux
- How do I set up passwordless login in PuTTY?
- UNIX commands
- Updating host keys