In this guide, we will configure SSH and SFTP access to an AWS Amazon Linux server.
Log in to your Amazon Linux server.
Create a new user (in this example, "fred") and set a password for the user:
sudo useradd fred
sudo passwd fred
sudo su fred
ssh-keygen -f ~/.ssh/id_rsa
.ssh directory and authorized_keys file with the correct permissions:mkdir ~/.ssh
touch ~/.ssh/authorized_keys
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
~/.ssh/id_rsa.pub) to the authorized_keys file:cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
sudo vi /etc/ssh/sshd_config
PasswordAuthentication no
AllowUsers ec2-user fred
Save the configuration and exit the text editor.
Restart the SSH service to apply the changes:
sudo systemctl restart sshd
Download the private key (id_rsa) to your local machine.
If you are using Windows, use PuTTYgen to convert the private key to PPK format.

Use an SSH client like PuTTY to connect to the server using the private key (PPK) and the username "fred."

