SSH into your container
Do not use SSH to install software required for production. Servers should be able to go down at any time and be started at any time wi th no human intervention. If you need custom software installation, please refer to this guide. SSH is provided in the rare case you need to go on an actual production container to debug and check when something cannot be reproduced or has gone horribly wrong.
Creating a keypair
First of all you should have a key pair specific to you on your computer. In order to check if you have one, simply type ls ~/.ssh
in your console.
As above, if you do not see id_rsa and id_rsa.pub, then you need to create one by using the ssh-keygen
command:
Now you can simply run ls ~/.ssh/
again to check that you have a key pair.
Uploading your public key
In order to SSH into a machine you ONLY have to provide it with your Public Key or id_rsa.pub
. This will allow the machine to identify you. NEVER transmit your Private Key id_rsa
over the network.
Open your Dashboard and click on the Settings button on the top right, then click on SSH Keys tab.
Then, lick on the Add new public key button to add a new user key.
You will need to display your public key by typing cat ~/.ssh/id_rsa.pub
Simply copy the public key body (starting with ssh-rsa), and paste it in the Public Key field. Also don't forget to fill the Key Name field with a username that you would like to use to log in with. Please note that Key Name field allows only letters, numbers and underscores with no white spaces.
Once you are done, you should see a list of your public keys that stored to your account.
Attach the public key to your application stack
Then, let's head to application settings page and attach the public key to your servers.
Scroll the page down, and click on Choose Key Pairs button.
You will see the list of public keys you stored at your account, simple click Attach button to add the key to your servers (the current application servers only).
Head to the Logs tab and watch the moDaemon
logs of your server until you see something like:
That will indicate your user has been added to the container.
SSH into your container
First, you need to decide which container you want to SSH into. You can find the IP addresses of each server on the stack details page.
You can log into the container by specifying the SSH user name (using the key name of the key pair registered in the application stack) and the IP address of the server. Executing the SSH command as follows:
Check your SSH history
It is possible to see who has entered your server by viewing the auth logs. Simply go to the stack Logs page, select ssh
, and you should see the authentication logs for the machine.
Last updated