Step 1
sed -i 's/^#\?PermitRootLogin .*/PermitRootLogin yes/' /etc/ssh/sshd_config
Step 2
2.1. Public key authentication
How do I register my SSH public key for `root' in Linux from the command line?
2.2. Password authentication
sed -i 's/^#\?PasswordAuthentication\s.*/PasswordAuthentication yes/'
Step 3
service ssh restart
on Amazon Linux:
/etc/init.d/sshd restart