It seems from the EC2 documentation that one must logon with the specific userid associated with the AMI:
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html
Use the ssh command to connect to the instance. You'll specify the private key (.pem) file and user_name@public_dns_name. For Amazon Linux, the user name is ec2-user. For RHEL5, the user name is either root or ec2-user. For Ubuntu, the user name is ubuntu. For Fedora, the user name is either fedora or ec2-user. For SUSE Linux, the user name is root. Otherwise, if ec2-user and root don't work, check with your AMI provider.
ssh -i my-key-pair.pem [email protected]
Now I have tried to logon with a different user - that was created via adduser:
adduser changsha
That user works on the system:
root@ip-10-151-25-94 ~]$ su - changsha
[changsha@ip-10-151-25-94 ~]$
However it is not (apparently) possible to logon to the AWS instance using that id. Notice: no "Enter Password" is returned. It just fails straightaway.
13:36:28/sparkup2 $ssh -i ~/.ssh/hwspark14.pem [email protected]
Permission denied (publickey).
The only thing working presently is to logon with root! So then - how do we manage multiple users on the cluster?
Update David's answer works: here is some additional info
https://forums.aws.amazon.com/message.jspa?messageID=138588
You should find an authorized_keys file (I'm using Ubuntu 12.04, this might change with other distros, I guess).
Let's check what it is:
$ cat ~/.ssh/authorized_keys
Outuput:
ssh-rsa SAGsg43 (....) sd53ySGS aws_machines
And that is the corresponding public key.