Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

3 Answers

up vote 1 down vote accepted

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

share|improve this answer
    
Great, got that. Now I need to get their SSH. How do I go about that. –  Tvanover Jun 24 '11 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. –  Shocm Jun 24 '11 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. –  Shocm Jun 24 '11 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 '11 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/… –  Shocm Jun 24 '11 at 21:59
show 1 more comment

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

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.