Suppose you’ve already created an Amazon Elastic Cloud Computing (EC2) server, and are able to host simple content. Now, how do you get your existing content onto the machine? What if you need to install a new Unix program that’s not available through yum?
You could install and configure an FTP server. But enabling FTP is a security nightmare. Fortunately, there’s no need to go that far. If a server supports secure terminal sessions using the SSH protocol (which an EC2 server does), it also supports uploading and downloading files using Secure FTP (SFTP).
To access your Amazon server using SFTP on Windows, download a Windows SFTP application. My personal favorite is WinSCP; using WinSCP, you’ll be in your EC2 server instance’s file system in minutes. Download and install the application. (You can ignore the request to reboot; WinSCP’s claim that it needs to restart your system to work is pure fabrication.) Launch the application from your Start menu, and put the appropriate values into the Host name and User name fields. For Private key file, you select the same private key file you created with PuTTY to enable SSH sessions.
Click Login, and you’ll establish an SFTP session with your server. WinSCP offers some nice features that make it easy to work with your EC2 server. For example, a command in the button bar opens a PuTTY SSH terminal session using the same credentials you used for your SFTP session. (You can also launch a PuTTY session by clicking CTRL+P.)
You can now upload any content you like to your public_html directory (assuming that ec2-user can write to it), and host content such as HTML files and PHP applications that you’ve written locally.
We still haven’t touched on advanced user management. Up until now, we’ve relied upon the well-known username ec2-user for all of our server management needs. If you work on a team or hire outside vendors, giving users access to your system with the appropriate level of permissions is critical. In my next article, we’ll use WinSCP to upload an EC2 private key file (.pem) to our server, and use it to create a new user whose only job is to secure access to our Web server’s public_html directory.
Latest posts by Jay Andrew Allen (see all)
- Creating New Linux Users and Login Keys on Amazon EC2 - December 22, 2010
- Upload Files to Your Amazon EC2 Server using WinSCP - December 16, 2010
- How to Point a Domain to an Amazon EC2 Virtual Server - December 8, 2010