-
Notifications
You must be signed in to change notification settings - Fork 12
Docker Container SSH Keys
Traun Leyden edited this page Nov 10, 2015
·
5 revisions
This assumes that you have a key on your host called id_rsa
which corresponds to the AWS key you used to kick off the cluster.
$ mkdir ~/.ssh
Find the container id
$ docker ps
Assume it's 9109e0e544b6
.
Copy the keys from the host->container:
$ docker cp ~/.ssh/id_rsa 9109e0e544b6:/root/.ssh
$ docker cp ~/.ssh/id_rsa.pub 9109e0e544b6:/root/.ssh
NOTE: if you are using a different keyname than id_rsa
/ida_rsa.pub
, you will need to tell your ssh client to use that key with these steps:
$ eval "$(ssh-agent)"
$ ssh-add ~/.ssh/id_rsa_tleyden
From the container
Find one of the hostnames from the AWS console and then ssh into it with the centos
user:
$ ssh [email protected]
(replacing ec2-54.. with actual hostname)