How to create a .PEM login key
$ useradd newuser
$ ssh-keygen -b 2048 -t rsa -f key -C newuser
$ su - newuser
$ mkdir .ssh && cd .ssh
$ cat > authorized_keys < key.pub
$ chmod 0700 ~/.ssh $ chmod 0600 ~/.ssh/authorized_keys
Rename the key to newuserkey.pem for a clearer file purpose
$ mv key newuserkey.pem
Then to access the server from anywhere:
$ ssh -i newuserkey.pem newuser@ec2_host_name