Category:Featured ArticlesTechnical SupportTags:command linecpanellinuxnewusertutorialpermissionsserverssh
If you have an account on a cPanel server with shell access or your own VPS or Dedicated server running Linux then SSH is a powerful tool to have in your skill set.
SSH(akaSecure Shell) is a way of logging into your server from a remote computer such as your home desktop or laptop. The remote connection utilizes encryption on both the servers end and your end to keep the entire session secure.
The most common type of connection that our support department uses is to SSH into a server as the root user. Logging in as root allows you to make systemwide changes, restart important services, and perform many other tasks that only the root user is allowed to do (by default).
If you are going to initiate your remote connection from a Linux or Mac OS X computer you can start using SSH by opening up the Terminal application. Linux users should know how to find the terminal, and Mac OS X users need only open their Applications folder and then the Utilities folder to find Terminal.app. Unfortunately SSH is not built-in to Windows, so you will need to download an application likePuTTY.
Once your terminal is open you can start your SSH session as root using the following command:
(where m is your servers name)
This commands tells your computer I want to open a new SSH session to the server called host.servername.com, and I want to log in as the user root.
If this is your first time connecting to the server using this hostname your SSH client will ask if you are sure you want to connect to a new, previously unknown host. Say yes and you will be prompted for the root accounts password (or simply, root password). After you have typed in the password and it is accepted you will be logged in to the server as the root user.
Before you continue, it is important to note that logging in to a server as root is a powerful but also potentially DANGEROUS system administration tool. The root user is allowed to change/delete practically everything in a server without any type of warning or confirmation of changes being made. Always backup your files before you modify them using a simple backup command:
For new shell users, the above command breaks down like so:
The prompt. Shows you your username (
) and the name of the server you are logged into (
). For example: If you were logged into a server called webstuff1 and your username was bill, your prompt might display
indicates the directory you are currently looking at/working in (
The copy command. Tells the server to copy the file to a new file with a different name, or the same name but in a different location (path).
The new copy of the file that will be created. You can also specify a new location like /home/username/file.bak .
To review, the above command creates a copy of file in the same location as the original and calls it file.bak.
If this is your first time using a shell interface, be sure to check out part two of the New User Tutorial series:Basic Shell Commands.
You can alsosetup SSH keysfor easier authentication,restart some services from the command linechange the SSH portto a different port number,learn how to use pipesto send the output from one command to another command, or even tellSSH to stop allowing the root user to connect.
Liquid Webs Heroic Support is always available to assist customers with this or any other issue. If you need our assistance please contact us:
Updating an A record from Command Line
Apache Error: semget: No space left on device
New User Tutorial: Basic Shell Commands
How To: Give a Linux User Root-level Access Using sudo
How To: Change Monitoring Settings Using Manage
Our Heroic Sales and Support teams are available 24 hours byphone or e-mailto assist.