Sie sind auf Seite 1von 11

How to connect to your Amazon Instance? What is SSH? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 What is an SSH Private Key? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2 How can I download my private SSH key from the BitNami Hosting Control Panel? . . . . . . . . . . . . . . 2 How can I download my private SSH key from Amazon EC2 Control Panel? . . . . . . . . . . . . . . . . . . . . . 2 How can I get my private SSH key in PPK format? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 How can I use SSH to connect to my server on Linux or Mac OS X?. . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 How can I access my server as the root user? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 How can use SSH to connect to my server on Windows? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Putty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 MobaXterm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

How to give SSH access to the another person or your customer ? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8


Create a separate account . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Use the 'bitnami' account . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

Does BitNami Hosting provide a way of setting up DNS so regular domain names can be set to point to the AWS url?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 How to connect to the BitNami MySQL remotely? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 How to enable phpMyAdmin or phpPgAdmin to be accessed remotely securely through SSH? . . . . 10

How to connect to your Amazon Instance?


What is SSH?

SSH stands for Secure Shell Handler and is a protocol used to connect securely to a remote server and execute commands. It is the equivalent of opening a terminal window on the remote server. To connect to a BitNami hosted server, you will need a special file named "Private Key", that is associated with your Amazon EC2.
What is an SSH Private Key?

Each Amazon cloud account has an associated SSH key file ("Private key") that you can use to connect remotely to the servers launched using that cloud account credentials. This file needs to be protected, as anybody who has access to it can access your servers. On Linux and OS X, it is necessary to change its permissions, so it is only readable by you. $ chmod 600 bitnami_hosting.pem Otherwise you may get a 'bad permissions: ignore key' error.
How can I download my private SSH key from the BitNami Hosting Control Panel?
You can download his file going to Clouds > Manage, clicking on the appropriate cloud account, then on the 'Download Key' button and select the appropriate format:

Select PEM format if you are going to connect from Linux, OS X or other Unix systems Select PPK for Windows Putty, FileZilla and WinSCP.
How can I download my private SSH key from Amazon EC2 Control Panel?

It is not possible to download the SSH key from the Amazon EC2 Control Panel once it has been created. If you launched your server using the Amazon EC2 Control Panel and selected the option to generate a new key pair, it would have been available for download at that time.
How can I get my private SSH key in PPK format?

PPK is the private key format used by Putty, FileZilla and WinSCP. If you are a BitNami Cloud Hosting client, you can download your key in this format directly: click "Connect" in "Server Manage" view and use "PPK" button. Otherwise, you will need to convert your downloaded key to PPK format as described here: http://the.earth.li/~sgtatham/putty/0.60/htmldoc/Chapter8.html#puttygen-conversions

How to connect to your Amazon Instance?

How to connect to your Amazon Instance?

How to connect to your Amazon Instance?

How can I use SSH to connect to my server on Linux or Mac OS X?

Linux and Mac OS X come bundled with SSH clients by default. To connect to your server using SSH, you need to open a Terminal and type the following: $ ssh -i bitnami_hosting.pem bitnami@example.com You will need to replace bitnami_hosting.pem with the path to your private key file and replace example.com with the IP address or hostname of your server. You can find out the hostname of a server by going to the Servers page, selecting the server and clicking 'Manage Server'. The hostname will appear next to Public DNS and it will be similar to 'ec2-xyz.compute-1.amazonaws.com'. Of course a server needs to be running so you can connect to it. Make sure your SSH key bitnami_hosting.pem has proper permissions. You can set the permissions using the command below:

How to connect to your Amazon Instance? $ chmod 600 bitnami_hosting.pem


How can I access my server as the root user?

By default, you can only log in as the 'bitnami' user to a BitNami EC2 instance. Once logged in, you can use the 'sudo' utility to become the super user or execute. $ sudo su
How can use SSH to connect to my server on Windows?

Putty Windows does not come with a bundled SSH client by default. It is recommended that you use the freely available Putty utility, which can be downloaded from: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html You will need to get your SSH key in PPK format: http://wiki.bitnami.org/cloud/ how_to_connect_to_your_amazon_instance#How_can_I_get_my_private_SSH_key_in_PPK_format.3f Once you have your key in PPK format, you can connect following this steps: Start "Pageant" ( Start Menu -> Programs -> Putty -> Pageant ). Click "Add key" and choose the PPK file. Open "Putty" application ( Start Menu -> Programs -> Putty -> Putty ). Go to Connection -> Data using the left menu. Enter "bitnami" as the "Auto-login username". Go to "Session". Insert your server Public DNS (ec2-xyz.compute-1.amazonaws.com / xyz.bitnamiapp.com) in the "Host Name" field. You can find this in Server Management for BitNami Cloud Hosting servers or in the instance properties in Amazon console. 8. Click "Open" to start the SSH session. If you prefer to use putty from the command line you should include '-i' and '-l' options as follows: > putty -i "C:\Path\To\bitnami-hosting.ppk" -l bitnami example.com Where you will need to replace example.com with the IP address or hostname of your server. You can find out the hostname of a server by going to the Servers page, selecting the server and clicking 'Manage Server'. The hostname will appear next to Public DNS and it will be similar to 'ec2-xyz.compute-1.amazonaws.com'. Of course a server needs to be running so you can connect to it. MobaXterm MobaXTerm is an enhanced terminal with an X server and a set of Unix commands (GNU/Cygwin) packaged in a single
portable exe file. You can dowload it at:

1. 2. 3. 4. 5. 6. 7.

http://mobaxterm.mobatek.net In this case it is not necessary to import your private key, you can use it directly.

How to connect to your Amazon Instance?

How to connect to your Amazon Instance?

You can copy files to the machine using the right panel or you can connect to the machine through SSH: $ ssh -i private_key bitnami@your-machine-hostname
How to give SSH access to the another person or your customer ?

It is better if you ask your customer to send you his own public ssh key generated on Linux/Unix/OS X, this way you can give him an access to your machine without sharing your private keys. Copy this file my_customer_public_ssh_key to your server. Now you have two options: you can create a separate account for him (RECOMMENDED) or just allow him to log into the server using the 'bitnami' account
Create a separate account

Add myadmin account and set the password: $ sudo adduser --ingroup admin myadmin Adding user `myadmin' ... Adding new user `myadmin' (1004) with group `admin' ... Creating home directory `/home/myadmin' ... ... 8

How to connect to your Amazon Instance? $ $ $ $ sudo sudo sudo sudo mkdir /home/myadmin/.ssh cp ~/my_customer_public_ssh_key /home/myadmin/.ssh/authorized_keys chown -R myadmin:admin /home/myadmin chmod 600 /home/myadmin/.ssh/authorized_keys

Right now your customer can login as 'myadmin' user using his own ssh key and use 'sudo' with password set above.
Use the 'bitnami' account

Backup your old authorized_keys: $ cp /home/bitnami/.ssh/authorized_keys /home/bitnami/.ssh/ authorized_keys.bak Add your customer key to authorized_keys (PLEASE BE EXTREMELY CAREFUL to avoid losing ssh access at all) $ cat ~/my_customer_public_ssh_key >> /home/bitnami/.ssh/authorized_keys Now you both are able to access the machine. You can revert the changes by removing the last line from the /home/bitnami/.ssh/authorized_keys file or by restoring the old authorized_keys file: $ cp /home/bitnami/.ssh/authorized_keys.bak /home/bitnami/.ssh/ authorized_keys
Does BitNami Hosting provide a way of setting up DNS so regular domain names can be set to point to the AWS url? BitNami Hosting launches instances with a dynamic IP by default, which means that the IP address changes after you stop and restart the machine. In many cases, this is not desired and instead you want to assign a specific IP address (also known in EC2 as elastic IP). To do so, go to the Manage section, click Assign IP and choose one of the already available IP addresses or select Newly created static IP to create a new one. Then, click Confirm. Your machine should be accessible with the new IP, though it may take a a few minutes. You can point an existing domain name to a dynamic or static IP address. To do so, go to your DNS provider management console and point the domain name to the BitNami Hosting machine IP. It may take some time before all DNS servers refresh the new domain location. We do not currently allow creating or managing domain names from the BitNami Hosting interface yet. How to connect to the BitNami MySQL remotely? Currently it is not possible to connect remotely to the machine port 3306. The default AWS Security Group does not allow it. However you can do the following:

Navicat configuration

How to connect to your Amazon Instance?


- In the connection properties set the following values - The latest version of Navicat supports setting up a ssh tunnel automatically. Host Name: localhost Port: 3306 User Name: root Password:<set during machine build> - Then click SSH tab. - Mark Use SSH Tunnel - Enter the following values: Host Name: ec2-your-machine Port: 22 User Name: bitnami Authentication Method: Public key Private Key: your-key-dir/bitnami_hosting.pem

Generic solution - it should work with default MySQL client


Set up the ssh tunnel. This will set up the ssh tunnel and remote MySQL will be available via localhost:33306. You can also use Putty to run the command on Windows. $ ssh -v -N -L 33306:localhost:3306 -i your-key-dir/bitnami_hosting.pem bitnami@ec2-your-machine

- You can test it now in the another terminal window: $ mysql -h localhost -P33306 -u root -p --protocol=tcp - You can configure any other MySQL client program in the following way: - port: 33306 - hostname: localhost - login: root - password: <set during machine build>

10

How to connect to your Amazon Instance?


How to enable phpMyAdmin or phpPgAdmin to be accessed remotely securely through SSH?

By default phpMyAdmin and phpPgAdmin are not accessible from the outside for security reasons. In order to access them, you can create an SSH tunnel to Apache, sending your requests to your webserver from 127.0.0.1 (localhost). You should follow these steps to create the tunnel: 1. Get your SSH private key if you don't have it already. More info: http://wiki.bitnami.org/cloud/ how_to_connect_to_your_amazon_instance 2. Create the tunnel. - If you are in Linux or Mac you can run the following in a console in your local machine (using your Public DNS instead of xyz.bitnamiapp.com):
$ ssh -v -N -L 8888:127.0.0.1:80 -i bitnami_hosting.pem bitnami@xyz.bitnamiapp.com

- If you are using Windows you can use Putty: Follow the steps described here http://wiki.bitnami.org/cloud/ how_to_connect_to_your_amazon_instance#Putty Before opening the connection. Go to Connection -> SSH -> Tunnels, enter the values below and click "Add" button: ? Source port: "8888" ? Destination: "localhost:80" Click Open 3. While the tunnel is active you can connect to the web application at http://127.0.0.1:8888/phpmyadmin or http://127.0.0.1:8888/phppgadmin in your browser. The default login is: username: root ("administrator" for legacy versions) password: bitnami (for BitNami AMIs), <application password> (for BitNami Cloud Hosting) Take a look at this link about how to get your application password for BCH servers

11

Das könnte Ihnen auch gefallen