Logging Into Your Server via Secure Shell (SSH)

If you're comfortable using WHM and cPanel, you might be ready to use a command line interface (also called a terminal or the CLI) to access your server. The command line is a way to control your computer using only the keyboard and text-based commands. The command line was the only way people could control computers until the 1960s. Every computer still has a way to use command line commands.

You don't need to use the command line to change basic settings on your server: WHM works well for most things you'll want to change. Looking at terminal output can be intimidating, but a basic knowledge of command line can make some things easier.

terminal sample

To use a terminal to make changes on your server, the first step is to log into your server using the Secure Shell protocol (SSH). If you aren't familiar with SSH, it's a good idea to read about basic SSH concepts first.

Sometimes you'll hear “SSH” as a verb: “I'm going to SSH into my server.” This is the same as logging into your server via SSH. Logging into your server via SSH encrypts network traffic between your workstation and the server. This can help prevent malicious attacks but if your password or workstation is already compromised, you are still vulnerable to attack. See our article Best Practices: Securing Your Computer to see how to keep your workstation secure.

  1. Open the terminal (command line interface) on your computer. Every operating system has a different terminal program.

    SSH on Windows with PuTTY

    PuTTY is a common SSH client that will allow you to log into your server via SSH from a Windows computer. There are many other SSH clients and you may find another one your prefer.

    1. Download PuTTY and open the program. You'll see a configuration window.

    2. In the Host Name field, enter your server's IP address or hostname.

    3. For the Connection Type, click on SSH.

    4. If you use a port other than 22, you need to enter your SSH port into the Port field.

    5. Click Open to connect to your server. The first time you do this, you will see a warning about the host key. Make sure you have entered the correct connection information and then click Yes.

    6. Now you'll be asked to enter your root username and password. Enter your username (probably "root") and your password and press Enter. As long as your password is correct, you'll be logged into your server and can use regular command line commands!

    • On Windows: Windows doesn't include SSH capabilities by default in its command line terminal. You'll need to use an SSH client like PuTTY. Alternatively, you can modify your Windows desktop to support SSH. To learn how, see our article on Using SSH Client Natively in Windows 10.



    • On Mac OS: Click on your Applications icon, then search for “Terminal.” Click on Terminal to launch your command line interface.

    • On Linux: Every distribution of Linux is different, but if you have a graphical interface, open your list of applications and search for “terminal.” Then click to open your terminal.

  2. You will see the name of your user on your terminal screen and a blinking cursor. It's time to start using commands!

    terminal sample

  3. The command to log in via SSH is ssh. You'll be logging in as the root user, so your username is “root.” To find the right server to connect to, you use your server's IP address to tell your ssh command where to go. To put all those pieces together, type
    ssh [email protected]

    Make sure to replace "youripaddress" with your server's IP address.

    Tip: Finding Your Server IP Address

    Don't know your server's IP address? It's simple to find!

    • Log into your AlpineWeb account.

    • Under Your Hosting Infrastructure, you'll see a listing of your servers. One of the main fields will be Primary IP. That's your server IP address!

      primary IP address section highlighted

  4. Press Enter.

  5. A prompt will appear asking for your server's root password. Type in the root password and press Enter. When typing passwords, you will not see anything change on your terminal screen. This is for security: your typing is still registering.

    terminal sample

  6. Once you've verified your identity with your password, the screen will show any failed login attempts and the last time someone logged into your server. You're logged into your server!
    terminal sample

  7. To close your server connection, type logout and press Enter.

Congratulations! You've successfully logged into your server via SSH. But what does that mean? You can do almost anything through your terminal that you'd do via WHM. Some people prefer to use their terminal to move files around and upload files to their server. Check out our article on useful Linux commands for beginners to learn more.

One of the few things you cannot do via WHM is change the firewall port your SSH connection uses. Once you're comfortable logging in and out of your server, explore Opening and Closing Firewall Ports and then change your SSH port to increase your server security.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Brute Force Detection (BFD)

Brute Force Detection(BFD) is a critically important part of protecting your server from...

WHM Getting Started Guide

Control your server without being a command line guru with WHM. Even if you only host one website...

Configuring cPanel Backups in WHM

You've spent a lot of time creating your website: what if something goes wrong? From a malicious...

Opening and Closing Firewall Ports

Every server at AlpineWeb has at least one software firewall to protect your server from...

Changing Your SSH Port with the Command Line

Firewalls have different ports that allow different services to access your server. There's a...