2

I am putting together a test environment using Amazon's EC2 for me and some friends to collaborate on a project. I am not a server guy but I do know my way around a bash prompt and have done some work on ubuntu before. I am using Amazon Linux AMI i386 EBS and have gotten apache and php running. Now I need to create the user accounts my friends and I will use to upload files (sftp) and work on the project (ssh). How should I go about this?

Should I just use adduser and configure it like normal?

Or should I use the AWS IAM groups?

3 Answers 3

2

Simple answer, to give you friends SSH access to the server use:

useradd -c "Friendly Version User Name" -s /bin/bash -m username
  • -c is just a comment but shows up in you passwd file and makes it a little easier to read
  • -s defines the shell. Bash is probably your default but for good measure I add it to my command
  • -m tells it to make the home directory for the user
  • username is the log in your friends will use

Make sure to get their SSH and add them to the authorized_keys file

6
  • Great, got that. Now I need to get their SSH. How do I go about that.
    – Tvanover
    Jun 24, 2011 at 16:24
  • Just get their SSH Public Key and add it to the .ssh/authorized_keys file in their home directory. Or you can enable password log in under /etc/ssh/sshd_conf ChallengeResponseAuthentication yesbut you'll need to set passwords for everyone. I typically used SSH keys, more secure all around. I usually script the creation of users to add the SSH keys automatically. Jun 24, 2011 at 16:36
  • You'll also want to make sure you have firewall rules that allow your friends to SSH to the box from where ever they are coming from. Besides the firewall, which is handled with AWS security groups, everything else is pretty standard Linux administration. Jun 24, 2011 at 16:38
  • I must be a bit of a bonehead here, but where do they get their ssh public key? I tried the instructions at codingthis.com/platforms/linux/… to generate the private & public key, moved the public key into the .ssh/authorized_keys downloaded the private one and fed it through puttygen to get the .ppk. But that doesn't work.
    – Tvanover
    Jun 24, 2011 at 21:45
  • We are kind of getting off topic here a little but it's a pretty standard SSH configuration. If you are using Putty you might want to try to walk through this site soniahamilton.wordpress.com/2008/09/05/… Jun 24, 2011 at 21:59
1

IAM only provides users & groups for accessing the AWS account features and has nothing to do with the EC2 instances themselves.

Adding users to the running instance is an exercise in management of the instances. By default the instance will have the root account. Some AMIs will include other users, like the Ubuntu UEC images include an ubuntu user which you log into and then become root via sudo.

Personally for the EC2 instances I use I make use of a Puppet server running outside of Amazon's cloud that the instances connect with and receive their configurations including user accounts and SSH identity keys to authenticate remote logins. Doing this I'm able to use a limited number of AMIs but run instances to provide various tasks.

0

IAM is for access to the AWS console and APIs. You'd use adduser as usual for accounts on the server itself.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .