Access your Simple Hosting by SSH Console

If you need shell access to your instance, you can activate the console via your instance's interface. Once activated, the console will be available for 2 hours. It will automatically disconnect after that for security reasons. Please note SSH keys are not currently supported for SSH console connections - only for sFTP and git access.

How to activate the Simple Hosting SSH console

Log into your instance's control panel, and then scroll down to your Access table:

sh-ssh-console.jpg

On the console line, you will find a link that you can click on to log in. If your web browser knows how to handle ssh:// (or knows what program to open to do this) just click on login. If you use an SSH client that is not in your web browser, the connection settings can be obtained by rolling your mouse over the icon.

  • The server is : console.dc0.gpaas.net.
  • The login is your Simple Hosting user used for SFTP
  • Your SSH password is the same as for the administration.

How to use the SSH console

When prompted, login to your instance using the information obtained above like this:

$ ssh 106734@console.dc1.gpaas.net

(Replace 106734 with your instance ID, and dc1 with the ID of your datacenter; both can be found in the tooltip shown in the screenshot above.)

Once connected, you will be identified as 'hosting-user'. This is exactly as if you were connected under SFTP.

Your departure point is also the same, ie. /srv/lamp0' which corresponds to your 'home directory” for this user.

Newer versions of OpenSSH might an following error upon connection

Unable to negotiate with X.X.X.X: no matching key exchange method found.
Their offer: diffie-hellman-group1-sha1

You can fix this by activating the algorithm for this specific connection:

$ ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 106734@console.dc1.gpaas.net

Or by adding this setting to your '~/.ssh/config' file:

Host console.dc1.gpaas.net
    KexAlgorithms +diffie-hellman-group1-sha1

Please refer to OpenSSH's website for more information: http://www.openssh.com/legacy.html

What you can use SSH console access for

Manipulating files

Once logged into your instance via SSH you may use common Linux commands such as mv, rm wget, etc to manage your instance's files and directories.

For example, below is an example of a Wordpress4 installation via SSH:

hosting-user@WordPress4:~$ cd web/vhosts/wp.gandi.ninja/htdocs/
hosting-user@WordPress4:~/web/vhosts/wp.gandi.ninja/htdocs$ wget http://wordpress.org/latest.zip
hosting-user@WordPress4:~/web/vhosts/wp.gandi.ninja/htdocs$ unzip latest.zip
hosting-user@WordPress4:~/web/vhosts/wp.gandi.ninja/htdocs$ mv wordpress/* .
hosting-user@WordPress4:~/web/vhosts/wp.gandi.ninja$ rm latest.zip
hosting-user@WordPress4:~/web/vhosts/wp.gandi.ninja$ rm index.html

Connecting to MySQL to make direct commands

You do not need to go through PHPmyAdmin for changes to your database. You can connect directly there with

  mysql -u root -h localhost -p

where you will then need to enter the password of the database that you set.

Viewing logs

To view your logs (ex. visitor occurrences, system errors, etc.) without going through sFTP use:

ls /srv/data/var/log/

This will give you a view of the dossiers containing the logs per application.

If, for example you want to see the latest logs of your web server Apache, type:

tail -f /srv/data/var/log/apache/access.log

You can return to your sftp root location at any time by using the cd command.

There is currently a bug in using the CTRL+C command to get out of command edition. We fixed it, but it has not yet been put in production, though will be soon. Actually, you can use CTRL+Z

Last modified: 08/12/2016 at 21:25 by Richard M. (Gandi)