Linux – Creating user accounts in Amazon EC2

amazon ec2linuxuser-accounts

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?

Best Answer

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