SiteHost

SSH / SFTP User Privileges

When logging in to access a Container via SSH, your session's working environment is spawned inside a new Container, inside which your application Container's environment gets mounted to grant you access to the application files. This means any changes outside of your home directory will not be persistent. However, everything stored in your user's home directory should remain.

Single vs Multiple Access Users

The number of commands available will vary slightly depending on whether your SSH / SFTP user has access to a single Container, multiple Containers, or Volumes. For instance, consider the following situations:

When the SSH / SFTP user is attached to a single Container:

  • SSH session Container is spawned using the same base image, giving you access to the version of software (PHP, Redis, etc.) your application is running on.

When the SSH / SFTP user has no Containers attached:

  • SSH session Container is spawned using a base image with basic Linux commands only.

When the SSH user is attached to more than one Container:

  • SSH session Container is spawned using a base image with basic Linux commands only.

When the SSH user is attached to one or more Volumes:

  • SSH session Container is spawned using a base image with basic Linux commands only.

The table below shows an example set of commands available to a user attached to a single Redis 3 container vs. a user attached to multiple containers:

Command Single Container Access Multiple Containers Access
Standard commands (cd, ls, chown, chmod, git, etc.)
redis-benchmark
redis-check-aof
redis-check-dump
redis-check-dump
redis-cli
redis-sentinel
redis-server

Using your own binaries

Each SSH user has been provided with a special directory to store your own binaries making them available anywhere without having to specify the full path. To do so you need to download/upload your binary (or script) inside the bin directory of your user's home directory.

Here is an example on how to download composer and use it to install SilverStripe on an Apache + PHP 5.6 container:

  1. Connect to your server via SSH, using a user you have previously created.
  2. Download composer and install it into your bin directory:
    cd ~
    curl -sS https://getcomposer.org/installer | php -- --install-dir=./bin --filename=composer
  3. Navigate to the public directory and start the install:
    cd ~/containers/application/public
    composer create-project --no-dev silverstripe/installer . 3.0.3

    SilverStripe requires an empty directory so make sure it is empty first.

  4. Open a web browser, navigate to your website and follow the SilverStripe installation procedure.

Readonly Configuration Files

There may be a situation where you wish to mark configuration files for your container as readonly to prevent certain SSH / SFTP users from modifying important settings. This can be easily achieved by following the simple steps below:

  1. When logged in to the SiteHost Control Panel, click the Containers module from the menu on the left.
  2. Click SSH & SFTP under Containers on the menu.
  3. Select the user in the list that you wish to modify.
  4. Check the Read Only Config option, select Yes or No accordingly.
  5. Hit the Save Changes button.