1. Switch to root user

sudo su

2. Create new user

adduser [username]

(For example, adduser admin ).

3. Assign password to a new user

passwd [username]

(For example, passwd admin ).

4. Enter password

5. To give the new user necessary privileges, assign that user to the appropriately privileged group. For example, to the www group in Amazon Linux, which has the privileges as per standard EC2 LAMP installation from the docs):

usermod -a -G www developer

6. Edit the sshd_config file to enable password authentification

nano /etc/ssh/sshd_config

Find the line that says PasswordAuthentification yes and uncomment it (remove # – this should be done in one place only, there’s a line just below that looks similar, do not edit it.

Save the file.

7. Open the sodoers list:

nano /etc/sudoers

8. Add these lines at the bottom (or in the corresponding area), to add the user to teh sodoers list:

## Allows user developer to run a sudo command
developer ALL=(ALL) ALL
## Allows user developer to sudo without having to supply a password

Save the file.

9. Restart the ssh service

service httpd restart

10. Test – you should now be able to log in via both ssh and SFTP as [username]@[IP address], using the password you assigned to that user.