luisfmelo
3/31/2017 - 10:55 AM

Server with SSH pair keys

Server with SSH pair keys

# In Personal Computer (SSH client) -> change the file name, user and ip address
ssh-keygen -t rsa
    > /home/...user.../.ssh/id_rsa_mySshCredentials

cat ~/.ssh/path_to_public_key/id_rsa.pub | sudo ssh -i path_to_pem_file.pem ubuntu@ip_of_aws_server "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"

# On Server (ssh server)
nano /etc/ssh/sshd_config

  ChallengeResponseAuthentication no
  PasswordAuthentication no
  UsePAM no

sudo service ssh restart