Connecting to Your Linux/UNIX Instance

To connect to your instance using SSH

1. Use the chmod command to make sure your private key file isn’t publicly viewable. For example, if the name of your private key file is my-key-pair.pem, you would use the following command:

chmod 400 my-key-pair.pem

2. Use the ssh command to connect to the instance. You’ll specify the private key (.pem) file and user_name@public_dns_name. For Amazon Linux, the user name is ec2-user. For RHEL5, the user name is often root but might be ec2-user. For an Ubuntu, AMI the user name is ubuntu. Otherwise, check with your AMI provider.

ssh -i my-key-pair.pem [email protected]

You’ll see a response like the following.

The authenticity of host 'ec2-198-51-100-1.compute-1.amazonaws.com (10.254.142.33)' can't be established.
RSA key fingerprint is 1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f.
Are you sure you want to continue connecting (yes/no)?

3. (Optional) If you’ve launched a public AMI, verify that the fingerprint in the security alert matches the fingerprint that you obtained in step 1. If these fingerprints don’t match, someone might be attempting a “man-in-the-middle” attack. If they match, continue to the next step.

4. Enter yes.

You’ll see a response like the following.

Warning: Permanently added 'ec2-198-51-100-1.compute-1.amazonaws.com' (RSA) to the list of known hosts.

Fonte: Amazon AWS.

Author

Rodrigo Calado é sócio-fundador e CTO do Gran Cursos Online. Graduado em Gestão da Tecnologia da Informação, pós-graduando em Governança de TI pela Universidade Católica de Brasília e cursou MBA em Gestão e Empreendedorismo pela FGV. Possui convicta paixão pela área de tecnologia, educação digital, concursos públicos e empreendedorismo.

4 Comments

  1. Sergio Nhaca Reply

    excelente
    o Zikaroto devia aprender um poquinho de ingles

  2. Bacana o tuto…
    Mas me deparei com um problema ? Criei a instancia e gerei um ppk. Estava funcionando legal o acesso pelo terminal. Mas agora está solicitando um senha de acesso ? Que senha é essa ? E como configuro ?

  3. Que zuera! Por que o título do artigo está em Português o o conteúdo em inglês?

Reply To Anônimo Cancel Reply