How To Connect To Your Server Using SSH

SSH is about as cool as sliced bread, if maybe not a little bit more so. Seriously, it’s a great way to get at your server’s terminal shell, which—as we all know—is the hotbed of power. From there you can change just about any aspect of the server, not to mention seriously screw things up if you don’t know what you’re doing.
“Secure Shell (SSH) is a network protocol for secure data communication, remote shell services or command execution and other secure network services between two networked computers that it connects via a secure channel over an insecure network: a server and a client (running SSH server and SSH client programs, respectively) — https://en.wikipedia.org/wiki/Secure_Shell.”
Regardless of your skill level or knowledgeability, if you’re going to do any serious web mastering with your server, you’ll need to access the server shell at some point. To do this, you’ll need to tunnel commands server-side via SSH. There are several ways to accomplish this, but each operating system treats the process slightly differently. Lucky for you, we’ve got a common way to get at your server via SSH for all three major operating systems. No need to thank us, though: This is by no means a comprehensive methods list, but rather just a quick guide to dipping your toe in the water. For more complex entry methods, hit up the Big-G and google it.

RELATED:   Cross Site Scripting: The Underestimated Website Attack

In the meantime, though, check below for our ways of getting to your server via SSH!

SSH Access For Windows

Windows is complicated, and because of that, we’ll get it out of the way quick. Windows, unlike Linux or Macintosh (which we’ll look at in just a second) is not based on UNIX, and does not come stock with any kind of SSH client. However, there are plenty of utilities out there that will get the job done. Without sending you to a search engine, though, you can use our favorite in the meantime: PuTTY.

This handy application provides a pleasant enough graphical interface from which to get at your server. Just enter the name of the host, then choose SSH as your connection type. If you’d like, you can save the information for further use. Then enter your username and password, and PuTTY should do the rest.

RELATED:   Securing Your Business Website in Three Easy Steps

Download PuTTY at https://www.chiark.greenend.org.uk/~sgtatham/putty/download.html.

For Linux

Linux, by nature of its internal coding, is much less of a pain in the derriere. All you have to do is locate your local terminal application (this varies from distro to distro, so look carefully) and then type the following string:
[code lang=”shell”]
ssh -l your-username yourserver-or-ip.com
[/code]

For Macintosh

For Mac users, enter the same command as above, only use the native Terminal application, which can be found in your Utilities folder. Easy as pie, right?

Basic SSH Commands

Here is a short list of some of the most common SSH commands.
[code lang=”shell”]
-h # The -h flag provides help on a command
ls # List the contents of the current directory
cd # Change to that directory or path
cp # Copy the source file to the destination
cp -r # Copy the source directory to the destination directory
mv # Move the source file to the destination
mkdir # Create a new directory
pico # Edit file in a friendly, easy to use file editor
grep # Search for text within a file
wget # Download the file at the given URI to the current path
tar -xz -f # Un-gzip and un-tar the given *.tgz or *.tar.gz file
rm # Delete the file
rm -r # Delete the directory and all contents
killall # Kill all running processes of the program
ps # Show running processes
top # Show running processes in a graphical frontend
netstat # Show all current network connections
du # Show disk usage
[/code]

RELATED:   Why Free Web Hosting Costs You Money

For more SSH commands check David Coe‘s https://www.sshcommands.co.uk/, an easy to understand list of SSH commands (with examples).