Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I configure multiple ssh access to an EC2 instance

I've been trying to setup access to my Amazon instance to my development team and have hit a bit of a brick wall. I've tried a bunch of different tutorials online & none seem to work. Here's my config:

  • I have access to the AWS Management Console & I'd rather that I be the central administrator of that account, they don't need to setup new instances.
  • I have a t1.micro instance setup Running 32 bit Amazon Linux AMI
  • My developer and I both use Macs. I am able to ssh in to the machine using my key pair that is assigned to the box
  • I've previously tried to ssh into the machine & add my developers key & but he keeps getting Permission Denied (Public Key)
  • I setup a keypair for my dev, but its obviously not tied to the account, mine is.

Do I have to setup the developer in IAM so that they login & setup the original key that I had to setup when I first created the account? Could that be what they are missing?

I did get one of them to setup a key on their machine & provide me the RSA info to insert into the ~/.ssh/authorized_keys file, however they still received the error message above. Even when their key was chmod'd correctly, they still received that error. Could that be due to chmod needed on the .ssh folder?

Just trying to get some clarity on requirements of accessing a linux-based EC2 instance that isn't the main admin of the account (i.e. my developers). FYI I trust them with full permissions on the instance.

Thanks.

like image 200
Brendan Marsh Avatar asked Jul 15 '11 00:07

Brendan Marsh


2 Answers

.ssh directory should be chmod 700.

like image 180
Alex Gitelman Avatar answered Sep 28 '22 09:09

Alex Gitelman


You don't need to created any IAM user for connection to your ec2 instance via ssh. You just need to add your developer's public key to ~/.ssh/authorized_keys in your instance. Be sure that ~/.ssh owner is ec2-user, it should be like that by default. Then the developers have to move their private key to ~/.ssh/id_rsa and do:

chown "dev_user"."dev_user" -R ~/.ssh/
chmod 400 ~/.ssh/id_rsa

"dev_user" is the local user for your developers. Then be sure that ~/.ssh folder's owner is the same that id_rsa file and have 700 permission:

chmod 700 ~/.ssh/

The developers just have to do:

ssh [email protected]
like image 30
AGL Avatar answered Sep 28 '22 09:09

AGL