UNIX – Using SSH and SCP

Background

SSH gives encrypted Unix shell access to the files you have stored on your EasyStreet hosting space. SSH is available to our Value and higher Unix hosting accounts.

For security reasons, EasyStreet offers a limited SSH access. SSH is provided as a tool for you to create, update, and maintain web pages, scripts and databases.

Terms of Use

The shell server is being provided without any warranty, or presumed warranty. You do not have to use this service if you do not want it. Finally, it is not included in any SLA and this service may be discontinued at any time.

We have taken a number of steps to keep this machine secure. However, we expect people to act maturely and use resources wisely. We reserve the right to deny users access to this service if we feel it is being abused.

Feature Availability

  • Use this server to edit/create/manage your website files.
  • Connecting to our database server sql.hosting.easystreet.com (or sql5.hosting.easystreet.com if using SQL 5) is allowed.
  • Off site Internet connections are not allowed from the shell, but are allowed from your web pages or scripts running under our web server. From the shell, youcannot make Internet connections to any other host except to our database servers.
  • You cannot read email here (your email is not hosted on this server).
  • Compiling code is not allowed.
  • You cannot run daemons/servers on this machine.
  • Your shell will be active for one hour, after which you will have to re-login.
  • Crontab and cron jobs are not available.
  • The overriding rule: Please use this responsibly.

Enabling SSH

SSH is disabled by default for all hosting packages. To enable SSH for your account, you’d:

1.  Login to your WebSiteOS.

2.  Click on the Security link in the upper left navigation bar.

clicksecurity

3.  If your hosting package comes with SSH, you should now see Secure Shell in the lower left section of your navigation. Click on the words Secure Shell and they should become highlighted:

sshmangager

4.  Your Secure Shell control panel should then appear in the center of your screen. If SSH is not enabled, your Secure Shell control panel will look like the following. To enable, put a check in the Enable this service checkbox, as shown below, and click the Next button at the bottom:

sshmangageroff

5.  You will then get a screen like the following. Your SSH username will be pre-defined, yourdomain.com. You would enter and confirm the password you would like to use with ssh. Warning: You may not use the same password that you use to log in to your WebSiteOS or FTP.

setsshpassword

6.  Click the Finish button at the bottom of the Secure Shell Control Panel.

7.  Click OK when you see the following dialog box:

sshenableok

8.  You’ll get confirmation that SSH has been enabled:

sshenabled

Connecting via SSH

Replace yourdomain.com with your actual domain.

  • Hostname:  shell.hosting.easystreet.com
  • Username:  yourdomain.tld
  • Password:  the password you specified
  • Protocol:   ssh2

Using SCP

Using SCP manually

The unix command SCP is enabled on this server which allows for secure copying of files over an ssh encrypted session. To use command line SCP, you must first have enabled ssh, and confirmed that you can log into this server via ssh. The computer you wish to connect from must have both ssh and scp available to you.

Navigate to the directory which has the files you wish to upload. Replacingyourdomain.com with your actual username on this server. Replace index.html with the file name you wish to upload. Notice that this command will publish documents into your public folder on our server, which is where web content lives. If you do not want the file you are copying to be available via the web, then use the private directory instead.

scp index.html yourdomain.tld@shell.hosting.easystreet.com:public

This saves the file index.html to the public directory of your web space at EasyStreet.

To retrieve the index.html file from your hosting space at EasyStreet, the order is reversed.

scp yourdomain.tld@shell.hosting.easystreet.com:public/index.html ./

This brings the file named index.html from the public directory on your EasyStreet hosting space and saves it to your current directory on your local machine, shown as ./in the example above.

Graphical SCP client

Some SSH clients offer the ability to do SCP file transfers using a graphical interface similar to FTP. The settings you would use would be the same as those used to connect via SSH:

Server: shell.hosting.easystreet.com

Protocol: ssh2

Username: yourdomain.tld

Password: password you set for SSH

Using SCP in batch mode

Some people familiar with ssh ask if it can be used in batch mode on our server. It can; however, the server must first be set up to allow connections via a stored public/private key rather than prompting you for a password each time. To do this you would:

  • User’s public keys go in ~/.ssh/authorized_keys (they’ll have to create the .ssh directory first, then put their pub key in a file called authorized_keys)
  • Permissions need to be correct or it will not work: home dir should be 0700, same for ~/.ssh, and the authorized_keys file should be 0600

Change Password

If you have already enabled SSH but had forgotten your SSH password, you can change it under the Secure Shell control panel, on the Users tab.

sshchangepasswd

You’d enter the password, confirm it and then click the Apply button to make the changes. You’d then click the OK button to finish.

Conventions

Your home directory begins at “/”. Yet, “/etc” is a system directory. This can be a bit confusing at first. Your web content goes in your public directory, which is is found at:/public.

If you are working with scripts using absolute, hard-coded paths and need to run them in the shell, consider using the environment variable DOCUMENT_ROOT in your code. This is always set properly and will work in the shell and when run through the web servers.

SSH Clients

Free SSH clients are available from:

Potentially more robust Commercial clients are available from:

© 2009 EasyStreet Online Services, Inc. All rights reserved.
EasyStreet and the EasyStreet logo are registered trademarks of EasyStreet Online Services. Certain other names, logos, designs, titles, words or phrases on this site may constitute trademarks, servicemarks or tradenames of EasyStreet or other entities, which may be registered in certain jurisdictions.