What is SSH?
SSH stands for “secure shell” and it allows you to connect directly to your web server and make changes to it in a secure way. When you “SSH into” a server you are able to work on the files that are on the server without having to send them back and forth through FTP. This is referred to as working “in the terminal” or “from a command line.” I’m not going to go any further into it because that’s not the point of this article, but if you’re interested there are plenty of resources online where you can learn more.
What does “in the terminal” mean?
If you’re like me and have become more and more technical over the years while blogging and building websites as a hobby, you’ve probably dabbled with, or at least considered, working “in the terminal.” Anytime you talk to a “real” back end developer you hear the term, especially if the person happens to be a Mac-lover. “In the terminal” or “from the command line” refers to working without a GUI (graphical user interface, pronounced “gooey”), and means working in a screen that looks something like this:
This is screenshot of a .php file that’s part of the shopping cart plugin I use on my knitting pattern site. Some of you may be thinking that this looks like DOS, and you’re right, that’s exactly what it looks like. If you can read this, you can work in the terminal.
Why would someone want to work in the terminal?
What you see above is the file that is currently running on my website. It’s not downloaded to my local computer, I’m connected to the server and editing the actual file. When I save, the file is changed on the server and the website immediately shows the changes. Clearly you probably don’t want to actually change a file that’s on a production site without first testing it, probably on a “dev” copy of your site, but that’s beyond the scope of this article.
The benefit of working this way is that you save yourself a lot of time. Why? Because you don’t have to FTP the files you want to work on down to your local machine, then edit them, then FTP them back up to see how they work. It’s really not such a big change if you’re used to editing your files with a text editor or an IDE like Eclipse. You may want to try it to see if you like it!
But HOW does one connect to their site this way?
Being a hobbyist, you almost certainly have cheap shared hosting like GoDaddy or the like, right? Most shared hosting does not come with SSH access enabled by default because most hobbyists simply do not need this feature. If you’re a GoDaddy customer with Linux hosting, you can get SSH access with just a click.
Log into your GoDaddy account and go to the Hosting section of My Products:
Click on the green “launch” button to open the Hosting Manager. The Hosting Manager looks something like this:
Mouse over the “Settings” tab to see the drop-down and go down to SSH:
The SSH screen looks like this:
Depending on your particular settings, you may see some warnings here about other changes to your hosting that need to be done before you can see and click that “enable” button. If your hosting account was set up several years ago, these changes might be quite involved, so be sure to read through everything first! If your hosting was set up more recently, enabling SSH should be a one-click change that is activated immediately once you click “Enable”.
Now that SSH is enabled, how do I connect?
Click on the “Home” tab and look for your IP address. Now go to a program on your computer that allows you to SSH and connect to that IP address. If you’re on a Mac, it already comes with a program called “Terminal” that allows you to do this. Open up a new window and type:
If you’re on a PC, you’ll need to download something to do this. I use Putty and it works great, and it’s free. Once you download Putty, you run it and you’ll get a config screen like this:
Put your IP address in the Host Name field and click Open to connect.
In either case, the first command you’ll see is “login as.” Enter your FTP username and hit enter. Then enter your FTP password and hit enter again.
That’s it, you’re in! Your screen should have a prompt that looks something like this:
And now you get to have fun navigating through Linux. If you’re not comfortable with Linux commands, I recommend bookmarking a Linux Quick Reference card and reading some of the Linux courses at Linux.org.
Feel free to ask questions in the comments if this isn’t clear!
* My goal with these articles is to help others who’re transitioning from the “casual” blogger/web designer to a more technical approach. As I make the transition myself I’ve found that there is a real lack of content geared towards those of us in the middle: everything seems to be either written for the WYSIWYG crowd or for trained and experienced CS people. But many of us don’t fall in either category!